Public Member Functions | |
TestMapSettingsManager () | |
const char * | getName () |
void | makeUserConfig () |
std::string | makeMetaFile (bool make_corrupt) |
void | runTests (IGameDef *gamedef) |
void | testMapSettingsManager () |
void | testMapMetaSaveLoad () |
void | testMapMetaFailures () |
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 |
|
inline |
|
inlinevirtual |
Implements TestBase.
std::string TestMapSettingsManager::makeMetaFile | ( | bool | make_corrupt | ) |
References TestBase::getTestTempFile(), and UASSERT.
Referenced by testMapMetaFailures(), and testMapSettingsManager().
void TestMapSettingsManager::makeUserConfig | ( | ) |
References Settings::createLayer(), Settings::getLayer(), Settings::set(), and SL_GLOBAL.
Referenced by testMapMetaSaveLoad(), and testMapSettingsManager().
|
virtual |
Implements TestBase.
References TEST, testMapMetaFailures(), testMapMetaSaveLoad(), and testMapSettingsManager().
void TestMapSettingsManager::testMapMetaFailures | ( | ) |
References MapSettingsManager::loadMapMeta(), makeMetaFile(), fs::PathExists(), and UASSERT.
Referenced by runTests().
void TestMapSettingsManager::testMapMetaSaveLoad | ( | ) |
References MapgenParams::bparams, DIR_DELIM, Settings::getLayer(), TestBase::getTestTempDirectory(), MapSettingsManager::loadMapMeta(), MapSettingsManager::makeMapgenParams(), makeUserConfig(), MapSettingsManager::saveMapMeta(), MapgenParams::seed, Settings::set(), SL_GLOBAL, UASSERT, UASSERTEQ, and MapgenParams::water_level.
Referenced by runTests().
void TestMapSettingsManager::testMapSettingsManager | ( | ) |
References SHA1::addBytes(), check_noise_params(), MapgenParams::chunksize, MapgenParams::flags, SHA1::getDigest(), Settings::getLayer(), MapSettingsManager::getMapSetting(), MapSettingsManager::getMapSettingNoiseParams(), MapSettingsManager::loadMapMeta(), MapSettingsManager::makeMapgenParams(), makeMetaFile(), makeUserConfig(), MapSettingsManager::mapgen_params, MAPGEN_V5, MG_LIGHT, MapgenParams::mgtype, NOISE_FLAG_EASED, MapgenV5Params::np_factor, MapgenV5Params::np_filler_depth, MapgenV5Params::np_ground, MapgenV5Params::np_height, fs::ReadFile(), MapSettingsManager::saveMapMeta(), MapgenParams::seed, MapSettingsManager::setMapSetting(), MapSettingsManager::setMapSettingNoiseParams(), SL_GLOBAL, UASSERT, and MapgenParams::water_level.
Referenced by runTests().