#include <functional>
#include <exception>
#include <sstream>
#include <vector>
#include "irrlichttypes_extrabloated.h"
#include "porting.h"
#include "filesys.h"
#include "mapnode.h"
Go to the source code of this file.
Classes | |
class | TestFailedException |
class | TestBase |
class | TestManager |
Macros | |
#define | TEST(fxn, ...) runTest(#fxn, [&] () { fxn(__VA_ARGS__); }); |
#define | UASSERT(x) |
#define | UTEST(x, fmt, ...) |
#define | UASSERTCMP(T, CMP, actual, expected) |
#define | UASSERTEQ(T, actual, expected) UASSERTCMP(T, ==, actual, expected) |
#define | EXCEPTION_CHECK(EType, code) |
Functions | |
bool | run_tests () |
bool | run_tests (const std::string &module_name) |
Variables | |
content_t | t_CONTENT_STONE |
content_t | t_CONTENT_GRASS |
content_t | t_CONTENT_TORCH |
content_t | t_CONTENT_WATER |
content_t | t_CONTENT_LAVA |
content_t | t_CONTENT_BRICK |
#define EXCEPTION_CHECK | ( | EType, | |
code ) |
Referenced by TestSerialization::testDeSerializeLongString(), TestSerialization::testDeSerializeString(), TestRandom::testPcgRandomRange(), TestRandom::testPseudoRandomRange(), and TestVoxelManipulator::testVoxelManipulator().
#define TEST | ( | fxn, | |
... ) runTest(#fxn, [&] () { fxn(__VA_ARGS__); }); |
Referenced by TestActiveObject::runTests(), TestAddress::runTests(), TestAreaStore::runTests(), TestBan::runTests(), TestClientActiveObjectMgr::runTests(), TestCollision::runTests(), TestCompression::runTests(), TestConnection::runTests(), TestCraft::runTests(), TestDataStructures::runTests(), TestEventManager::runTests(), TestFileSys::runTests(), TestGameUI::runTests(), TestGettext::runTests(), TestInventory::runTests(), TestIrrPtr::runTests(), TestKeycode::runTests(), TestLogging::runTests(), TestLua::runTests(), TestMap::runTests(), TestMapBlock::runTests(), TestMapNode::runTests(), TestMapSettingsManager::runTests(), TestMeshCompare::runTests(), TestModChannels::runTests(), TestMoveAction::runTests(), TestNodeResolver::runTests(), TestNoise::runTests(), TestObjDef::runTests(), TestProfiler::runTests(), TestRandom::runTests(), TestSAO::runTests(), TestSchematic::runTests(), TestSerialization::runTests(), TestServerActiveObjectMgr::runTests(), TestServerModManager::runTests(), TestServerShutdownState::runTests(), TestSettings::runTests(), TestSocket::runTests(), TestThreading::runTests(), TestUtilities::runTests(), TestVoxelAlgorithms::runTests(), TestVoxelArea::runTests(), TestVoxelManipulator::runTests(), TestAuthDatabase::runTestsForCurrentDB(), and TestModStorageDatabase::runTestsForCurrentDB().
#define UASSERT | ( | x | ) |
Referenced by assert_active_in_block(), check_noise_params(), compare_settings(), EventManagerTest::eventTest(), TestAreaStore::genericStoreTest(), TestBase::getTestTempDirectory(), TestMapSettingsManager::makeMetaFile(), Foobar::resolveNodeNames(), Foobaz::resolveNodeNames(), TestVoxelArea::test_addarea(), TestVoxelArea::test_diff(), TestVoxelArea::test_extent(), TestVoxelArea::test_intersect(), TestVoxelArea::test_minor(), TestVoxelArea::test_pad(), TestVoxelArea::test_plus(), TestSAO::testActivate(), TestBan::testAdd(), TestObjDef::testAddGetSetClear(), TestSettings::testAllSettings(), TestUtilities::testAngleWrapAround(), TestActiveObject::testAOAttributes(), TestUtilities::testAsciiPrintableHelper(), TestThreading::testAtomicSemaphoreThread(), TestCollision::testAxisAlignedCollision(), TestUtilities::testBase64(), TestAddress::testBasic(), TestMoveAction::testCallbacks(), TestMoveAction::testCallbacksSwap(), TestAuthDatabase::testChange(), TestModStorageDatabase::testChange(), TestAuthDatabase::testChangePrivileges(), TestObjDef::testClone(), TestKeycode::testCompare(), TestConnection::testConnectSendReceive(), TestFileSys::testCopyFileContents(), TestAuthDatabase::testCreate(), TestBan::testCreate(), TestModStorageDatabase::testCreate(), TestLua::testCxxExceptions(), TestSettings::testDefaults(), TestAuthDatabase::testDelete(), TestSerialization::testDeSerializeLongString(), TestSerialization::testDeSerializeString(), TestUtilities::testEnrichedString(), TestUtilities::testEulerConversion(), TestSchematic::testFileSerializeDeserialize(), TestSettings::testFlagDesc(), TestSerialization::testFloatFormat(), TestMap::testForEachNodeInArea(), TestMap::testForEachNodeInAreaBlank(), TestMap::testForEachNodeInAreaEmpty(), TestServerActiveObjectMgr::testFreeID(), TestClientActiveObjectMgr::testGetActiveSelectableObjects(), TestBan::testGetBanDescription(), TestBan::testGetBanName(), TestServerModManager::testGetModMediaPaths(), TestServerModManager::testGetModNames(), TestServerModManager::testGetMods(), TestServerModManager::testGetModspec(), TestObjDef::testHandles(), TestConnection::testHelpers(), TestGameUI::testInfoText(), TestGameUI::testInit(), TestServerShutdownState::testInit(), TestSocket::testIPv4Socket(), TestSocket::testIPv6Socket(), TestUtilities::testIsBlockInSight(), TestFileSys::testIsDirDelimiter(), TestAddress::testIsLocalhost(), TestUtilities::testIsNumber(), TestUtilities::testIsPowerOfTwo(), TestUtilities::testIsYes(), TestModChannels::testJoinChannel(), TestModChannels::testLeaveChannel(), TestModStorageDatabase::testListMods(), TestMapBlock::testLoad20(), TestMapBlock::testLoad29(), TestMapBlock::testLoadNonStd(), TestLua::testLuaDestructors(), TestSchematic::testLuaTableSerialize(), TestDataStructures::testMap1(), TestDataStructures::testMap2(), TestDataStructures::testMap3(), TestDataStructures::testMap4(), TestMapSettingsManager::testMapMetaFailures(), TestMapSettingsManager::testMapMetaSaveLoad(), TestMapSettingsManager::testMapSettingsManager(), TestMap::testMaxMapgenLimit(), TestBan::testModificationFlag(), TestMoveAction::testMove(), TestMoveAction::testMoveFillStack(), TestMoveAction::testMovePartial(), TestMoveAction::testMoveSomewhere(), TestMoveAction::testMoveSomewherePartial(), TestMoveAction::testMoveUnallowed(), TestSchematic::testMtsSerializeDeserialize(), TestUtilities::testMyround(), TestConnection::testNetworkPacketSerialize(), TestMapNode::testNodeProperties(), TestNodeResolver::testNodeResolving(), TestNoise::testNoise2dAtOriginWithZeroSeed(), TestNoise::testNoise2dBulk(), TestNoise::testNoise2dPoint(), TestNoise::testNoise2dWithFunPrimes(), TestNoise::testNoise2dWithMaxSeed(), TestNoise::testNoise3dAtOriginWithZeroSeed(), TestNoise::testNoise3dBulk(), TestNoise::testNoise3dPoint(), TestNoise::testNoise3dWithFunPrimes(), TestNoise::testNoise3dWithMaxSeed(), TestNoise::testNoiseInvalidParams(), TestFileSys::testNonExist(), TestSAO::testNotSaved(), TestIrrPtr::testNullHandling(), TestUtilities::testPadString(), TestFileSys::testPathStartsWith(), TestRandom::testPcgRandomBytes(), TestRandom::testPcgRandomNormalDist(), TestRandom::testPcgRandomRange(), TestNodeResolver::testPendingResolveCancellation(), TestProfiler::testProfilerAverage(), TestRandom::testPseudoRandomRange(), TestMeshCompare::testQuad(), TestEventManager::testRealEvent(), TestEventManager::testRealEventAfterDereg(), TestAuthDatabase::testRecall(), TestModStorageDatabase::testRecall(), TestAuthDatabase::testRecallChanged(), TestModStorageDatabase::testRecallChanged(), TestAuthDatabase::testRecallChangedPrivileges(), TestAuthDatabase::testRecallFail(), TestModStorageDatabase::testRecallFail(), TestFileSys::testRecursiveDelete(), TestIrrPtr::testRefCounting(), TestServerActiveObjectMgr::testRegisterObject(), TestBan::testRemove(), TestModStorageDatabase::testRemove(), TestUtilities::testRemoveEscapes(), TestFileSys::testRemoveLastPathComponent(), TestFileSys::testRemoveLastPathComponentWithTrailingDelimiter(), TestServerActiveObjectMgr::testRemoveObject(), TestFileSys::testRemoveRelativePathComponent(), TestUtilities::testRemoveStringEnd(), TestServerShutdownState::testReset(), TestAddress::testResolve(), TestCompression::testRLECompression(), TestFileSys::testSafeWriteToFile(), TestUtilities::testSanitizeUntrusted(), TestMapBlock::testSave29(), TestMapBlock::testSaveLoad(), TestIrrPtr::testSelfAssignment(), TestModChannels::testSendMessageToChannel(), TestInventory::testSerializeDeserialize(), TestSerialization::testSerializeJsonString(), TestSerialization::testSerializeLongString(), TestSerialization::testSerializeString(), TestThreading::testStartStopWait(), TestUtilities::testStartsWith(), TestSAO::testStaticSave(), TestSAO::testStaticToFalse(), TestSAO::testStaticToTrue(), TestGameUI::testStatusText(), TestSerialization::testStreamRead(), TestSerialization::testStreamWrite(), TestUtilities::testStrEqual(), TestUtilities::testStringAllowed(), TestUtilities::testStringJoin(), TestUtilities::testStringReplace(), TestUtilities::testStrToIntConversion(), TestMoveAction::testSwap(), TestMoveAction::testSwapFromUnallowed(), TestMoveAction::testSwapToUnallowed(), TestServerShutdownState::testTick(), TestThreading::testTLS(), TestMeshCompare::testTriangle(), TestServerShutdownState::testTrigger(), TestUtilities::testTrim(), TestUtilities::testUrlDecode(), TestUtilities::testUrlEncode(), TestUtilities::testUTF8(), TestVoxelManipulator::testVoxelArea(), TestVoxelAlgorithms::testVoxelLineIterator(), TestVoxelManipulator::testVoxelManipulator(), TestUtilities::testWrapDegrees_0_360_v3f(), TestUtilities::testWrapRows(), and TestCompression::testZlibCompression().
#define UASSERTCMP | ( | T, | |
CMP, | |||
actual, | |||
expected ) |
Referenced by compare_settings(), TestKeycode::testCreateFromString(), TestServerActiveObjectMgr::testGetAddedActiveObjectsAroundPos(), TestServerActiveObjectMgr::testGetObjectsInsideRadius(), TestModStorageDatabase::testListMods(), TestModStorageDatabase::testRecall(), TestModStorageDatabase::testRecallChanged(), and TestAddress::testResolve().
#define UASSERTEQ | ( | T, | |
actual, | |||
expected ) UASSERTCMP(T, ==, actual, expected) |
Referenced by TestCompression::_testZlibLimit(), assert_active_in_block(), check_noise_params(), TestAreaStore::genericStoreTest(), TestVoxelArea::test_add_p(), TestVoxelArea::test_add_x(), TestVoxelArea::test_add_y(), TestVoxelArea::test_add_z(), TestVoxelArea::test_contains_i(), TestVoxelArea::test_contains_point(), TestVoxelArea::test_contains_voxelarea(), TestVoxelArea::test_diff(), TestVoxelArea::test_equal(), TestVoxelArea::test_index_v3s16_all_neg(), TestVoxelArea::test_index_v3s16_all_pos(), TestVoxelArea::test_index_v3s16_x_neg(), TestVoxelArea::test_index_v3s16_xy_neg(), TestVoxelArea::test_index_v3s16_xz_neg(), TestVoxelArea::test_index_v3s16_y_neg(), TestVoxelArea::test_index_v3s16_yz_neg(), TestVoxelArea::test_index_v3s16_z_neg(), TestVoxelArea::test_index_xyz_all_neg(), TestVoxelArea::test_index_xyz_all_pos(), TestVoxelArea::test_index_xyz_x_neg(), TestVoxelArea::test_index_xyz_xy_neg(), TestVoxelArea::test_index_xyz_xz_neg(), TestVoxelArea::test_index_xyz_y_neg(), TestVoxelArea::test_index_xyz_yz_neg(), TestVoxelArea::test_index_xyz_z_neg(), TestVoxelArea::test_volume(), TestSAO::testActivate(), TestObjDef::testAddGetSetClear(), TestAddress::testBasic(), TestLogging::testBitCheck(), TestObjDef::testClone(), TestUtilities::testColorizeURL(), TestFileSys::testCopyFileContents(), TestServerModManager::testCreation(), TestLua::testCxxExceptions(), TestGettext::testFmtgettext(), TestMap::testForEachNodeInArea(), TestClientActiveObjectMgr::testGetActiveSelectableObjects(), TestServerModManager::testGetModMediaPaths(), TestServerModManager::testGetModMediaPathsWrongDir(), TestServerModManager::testGetModNames(), TestServerModManager::testGetModNamesWrongDir(), TestServerModManager::testGetMods(), TestServerModManager::testGetModspec(), TestServerModManager::testGetModsWrongDir(), TestObjDef::testHandles(), TestServerModManager::testIsConsistent(), TestVoxelAlgorithms::testLighting(), TestAuthDatabase::testListNames(), TestMapBlock::testLoad20(), TestMapBlock::testLoad29(), TestMapBlock::testLoadNonStd(), TestUtilities::testLowercase(), TestSchematic::testLuaTableSerialize(), TestDataStructures::testMap4(), TestDataStructures::testMap5(), TestMapSettingsManager::testMapMetaSaveLoad(), TestMap::testMaxMapgenLimit(), TestSchematic::testMtsSerializeDeserialize(), TestConnection::testNetworkPacketSerialize(), TestNodeResolver::testNodeResolving(), TestSAO::testNotSaved(), TestLogging::testNullChecks(), TestRandom::testPcgRandom(), TestRandom::testPseudoRandom(), TestAuthDatabase::testRecall(), TestAuthDatabase::testRecallChanged(), TestAuthDatabase::testRecallChangedPrivileges(), TestCompression::testRLECompression(), TestFileSys::testSafeWriteToFile(), TestUtilities::testSanitizeDirName(), TestUtilities::testSanitizeUntrusted(), TestMapBlock::testSave29(), TestAreaStore::testSerialization(), TestInventory::testSerializeDeserialize(), TestSerialization::testSerializeJsonString(), TestCraft::testShapeless(), TestSAO::testStaticSave(), TestSAO::testStaticToFalse(), TestSAO::testStaticToTrue(), TestServerModManager::testUnsatisfiedMods(), TestUtilities::testUTF8(), TestVoxelAlgorithms::testVoxelLineIterator(), TestCompression::testZlibCompression(), TestCompression::testZlibLargeData(), and TestCompression::testZstdLargeData().
#define UTEST | ( | x, | |
fmt, | |||
... ) |
Referenced by TestCompression::_testZlibLimit(), TestIrrPtr::testRefCounting(), TestCompression::testZlibLargeData(), and TestCompression::testZstdLargeData().
bool run_tests | ( | ) |
References g_logger, TestManager::getTestModules(), porting::getTimeMs(), LL_ERROR, rawstream, and Logger::setLevelSilenced().
Referenced by main().
bool run_tests | ( | const std::string & | module_name | ) |
References findTestModule(), g_logger, porting::getTimeMs(), LL_ERROR, rawstream, and Logger::setLevelSilenced().
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |