Luanti 5.16.0-dev
Loading...
Searching...
No Matches
TestScriptApi Class Reference
Inheritance diagram for TestScriptApi:
Collaboration diagram for TestScriptApi:

Public Member Functions

 TestScriptApi ()
const char * getName ()
void runTests (IGameDef *gamedef)
void testVectorMetatable (MyScriptApi *script)
void testVectorRead (MyScriptApi *script)
void testVectorReadErr (MyScriptApi *script)
void testVectorReadMix (MyScriptApi *script)
void testVectorReadFloat (MyScriptApi *script)
void testReadParamFloat (MyScriptApi *script)
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)

Additional Inherited Members

Public Attributes inherited from TestBase
u32 num_tests_failed
u32 num_tests_run
Private Member Functions inherited from LuaHelper
template<>
bool readParam (lua_State *L, int index)
template<>
s16 readParam (lua_State *L, int index)
template<>
int readParam (lua_State *L, int index)
template<>
float readParam (lua_State *L, int index)
template<>
v2s16 readParam (lua_State *L, int index)
template<>
v2f readParam (lua_State *L, int index)
template<>
v3f readParam (lua_State *L, int index)
template<>
std::string_view readParam (lua_State *L, int index)
template<>
std::string readParam (lua_State *L, int index)
template<>
std::string_view readParam (lua_State *L, int index)
 Read a string from Lua state L at index without copying it.
Static Private Member Functions inherited from LuaHelper
template<typename T>
static T readParam (lua_State *L, int index)
 Read a value using a template type T from Lua state L at index.
template<typename T>
static T readParam (lua_State *L, int index, const T &default_value)
 Read a value using a template type T from Lua state L at index.

Constructor & Destructor Documentation

◆ TestScriptApi()

TestScriptApi::TestScriptApi ( )
inline

References TestManager::registerTestModule().

Here is the call graph for this function:

Member Function Documentation

◆ getName()

const char * TestScriptApi::getName ( )
inlinevirtual

Implements TestBase.

◆ runTests()

void TestScriptApi::runTests ( IGameDef * gamedef)
virtual

Implements TestBase.

References TestBase::num_tests_failed, rawstream, TEST, testReadParamFloat(), testVectorMetatable(), testVectorRead(), testVectorReadErr(), testVectorReadFloat(), testVectorReadMix(), and BaseException::what().

Here is the call graph for this function:

◆ testReadParamFloat()

void TestScriptApi::testReadParamFloat ( MyScriptApi * script)

References EXCEPTION_CHECK, infostream, LuaHelper::readParam(), run(), UASSERT, and UASSERTEQ.

Referenced by runTests().

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

◆ testVectorMetatable()

void TestScriptApi::testVectorMetatable ( MyScriptApi * script)

References push_v2f(), push_v2s32(), push_v3f(), push_v3s16(), run(), and UASSERT.

Referenced by runTests().

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

◆ testVectorRead()

void TestScriptApi::testVectorRead ( MyScriptApi * script)

References check_v3s16(), read_v3s16(), run(), S16_MAX, S16_MIN, and UASSERTEQ.

Referenced by runTests().

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

◆ testVectorReadErr()

void TestScriptApi::testVectorReadErr ( MyScriptApi * script)

References check_v3s16(), EXCEPTION_CHECK, infostream, read_v3s16(), and run().

Referenced by runTests().

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

◆ testVectorReadFloat()

void TestScriptApi::testVectorReadFloat ( MyScriptApi * script)

References check_v3f(), EXCEPTION_CHECK, infostream, read_v3f(), run(), and UASSERT.

Referenced by runTests().

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

◆ testVectorReadMix()

void TestScriptApi::testVectorReadMix ( MyScriptApi * script)

References check_v3s16(), EXCEPTION_CHECK, infostream, read_v3s16(), run(), 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: