Public Member Functions | |
TestRandom () | |
const char * | getName () |
void | runTests (IGameDef *gamedef) |
void | testPseudoRandom () |
void | testPseudoRandomRange () |
void | testPcgRandom () |
void | testPcgRandomRange () |
void | testPcgRandomBytes () |
void | testPcgRandomNormalDist () |
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 Attributes | |
static const s32 | expected_pseudorandom_results [256] |
static const u32 | expected_pcgrandom_results [256] |
static const u8 | expected_pcgrandom_bytes_result [24] |
static const u8 | expected_pcgrandom_bytes_result2 [24] |
Additional Inherited Members | |
Public Attributes inherited from TestBase | |
u32 | num_tests_failed |
u32 | num_tests_run |
|
inline |
|
inlinevirtual |
Implements TestBase.
|
virtual |
Implements TestBase.
References TEST, testPcgRandom(), testPcgRandomBytes(), testPcgRandomNormalDist(), testPcgRandomRange(), testPseudoRandom(), and testPseudoRandomRange().
void TestRandom::testPcgRandom | ( | ) |
References expected_pcgrandom_results, PcgRandom::getState(), PcgRandom::next(), PcgRandom::setState(), and UASSERTEQ.
Referenced by runTests().
void TestRandom::testPcgRandomBytes | ( | ) |
References PcgRandom::bytes(), expected_pcgrandom_bytes_result, expected_pcgrandom_bytes_result2, and UASSERT.
Referenced by runTests().
void TestRandom::testPcgRandomNormalDist | ( | ) |
References ARRLEN, myround(), PcgRandom::randNormalDist(), and UASSERT.
Referenced by runTests().
void TestRandom::testPcgRandomRange | ( | ) |
References EXCEPTION_CHECK, PcgRandom::next(), PcgRandom::RANDOM_MAX, PcgRandom::RANDOM_MIN, PcgRandom::range(), SWAP, and UASSERT.
Referenced by runTests().
void TestRandom::testPseudoRandom | ( | ) |
References expected_pseudorandom_results, PseudoRandom::getState(), PseudoRandom::next(), and UASSERTEQ.
Referenced by runTests().
void TestRandom::testPseudoRandomRange | ( | ) |
References EXCEPTION_CHECK, PseudoRandom::next(), PseudoRandom::range(), SWAP, and UASSERT.
Referenced by runTests().
|
static |
Referenced by testPcgRandomBytes().
|
static |
Referenced by testPcgRandomBytes().
|
static |
Referenced by testPcgRandom().
|
static |
Referenced by testPseudoRandom().