Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
TestCraft Class Reference
+ Inheritance diagram for TestCraft:
+ Collaboration diagram for TestCraft:

Public Member Functions

 TestCraft ()
 
const char * getName ()
 
void runTests (IGameDef *gamedef)
 
void testShapeless (IGameDef *gamedef)
 
- Public Member Functions inherited from TestBase
bool testModule (IGameDef *gamedef)
 
std::string getTestTempDirectory ()
 
std::string getTestTempFile ()
 
void runTest (const char *name, std::function< void()> &&test)
 

Static Public Member Functions

static std::string getDumpedCraftResult (CraftInput input, IGameDef *gamedef)
 
static void registerItemWithGroups (const std::string &itemname, const std::vector< std::string > &groups, IGameDef *gamedef)
 

Additional Inherited Members

- Public Attributes inherited from TestBase
u32 num_tests_failed
 
u32 num_tests_run
 

Constructor & Destructor Documentation

◆ TestCraft()

TestCraft::TestCraft ( )
inline

References TestManager::registerTestModule().

+ Here is the call graph for this function:

Member Function Documentation

◆ getDumpedCraftResult()

std::string TestCraft::getDumpedCraftResult ( CraftInput input,
IGameDef * gamedef )
static

References IGameDef::getCraftDefManager(), and IWritableCraftDefManager::getCraftResult().

Referenced by testShapeless().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getName()

const char * TestCraft::getName ( )
inlinevirtual

Implements TestBase.

◆ registerItemWithGroups()

void TestCraft::registerItemWithGroups ( const std::string & itemname,
const std::vector< std::string > & groups,
IGameDef * gamedef )
static

References IItemDefManager::get(), IGameDef::getItemDefManager(), ItemDefinition::groups, IItemDefManager::isKnown(), ITEM_CRAFT, IWritableItemDefManager::registerItem(), SANITY_CHECK, and ItemDefinition::type.

Referenced by testShapeless().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ runTests()

void TestCraft::runTests ( IGameDef * gamedef)
virtual

Implements TestBase.

References TEST, and testShapeless().

+ Here is the call graph for this function:

◆ testShapeless()

void TestCraft::testShapeless ( IGameDef * gamedef)

References IWritableCraftDefManager::clear(), CRAFT_METHOD_NORMAL, ItemStack::deSerialize(), IGameDef::getCraftDefManager(), getDumpedCraftResult(), IGameDef::getItemDefManager(), IWritableCraftDefManager::initHashes(), IWritableItemDefManager::registerAlias(), IWritableCraftDefManager::registerCraft(), registerItemWithGroups(), and UASSERTEQ.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: