#include <boost/test/unit_test.hpp>
#include "random_new_synced.hpp"
#include "random_new_deterministic.hpp"
#include "config.hpp"
#include <sstream>
#include <iomanip>
Go to the source code of this file.
Macros | |
#define | GETTEXT_DOMAIN "wesnoth-test" |
#define | validation_get_random_int_num_draws 19999 |
#define | validation_get_random_int_max 32000 |
#define | validation_get_random_int_correct_answer 10885 |
Functions | |
BOOST_AUTO_TEST_CASE (validate_mt19937) | |
BOOST_AUTO_TEST_CASE (test_mt_rng_seed_manip) | |
BOOST_AUTO_TEST_CASE (test_mt_rng_config_seed_manip) | |
BOOST_AUTO_TEST_CASE (test_mt_rng_reproducibility) | |
BOOST_AUTO_TEST_CASE (test_mt_rng_reproducibility2) | |
BOOST_AUTO_TEST_CASE (test_mt_rng_reproducibility3) | |
BOOST_AUTO_TEST_CASE (test_mt_rng_reproducibility4) | |
BOOST_AUTO_TEST_CASE (test_mt_rng_reproducibility5) | |
BOOST_AUTO_TEST_CASE (test_mt_rng_reproducibility_coverage) | |
BOOST_AUTO_TEST_CASE (validate_get_random_int) | |
This test and the next validate that we are getting the correct values from the get_random_int function, in the class random_new. More... | |
BOOST_AUTO_TEST_CASE (validate_get_random_int2) | |
#define GETTEXT_DOMAIN "wesnoth-test" |
Definition at line 15 of file test_rng.cpp.
#define validation_get_random_int_correct_answer 10885 |
Definition at line 294 of file test_rng.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
#define validation_get_random_int_max 32000 |
Definition at line 292 of file test_rng.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
#define validation_get_random_int_num_draws 19999 |
Definition at line 290 of file test_rng.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
BOOST_AUTO_TEST_CASE | ( | validate_mt19937 | ) |
Definition at line 29 of file test_rng.cpp.
References i.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_seed_manip | ) |
Definition at line 40 of file test_rng.cpp.
References rand_rng::mt_rng::get_random_seed(), rand_rng::mt_rng::get_random_seed_str(), and rand_rng::mt_rng::seed_random().
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_config_seed_manip | ) |
Definition at line 83 of file test_rng.cpp.
References rand_rng::mt_rng::get_random_seed(), rand_rng::mt_rng::get_random_seed_str(), and rand_rng::mt_rng::seed_random().
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_reproducibility | ) |
Definition at line 132 of file test_rng.cpp.
References rand_rng::mt_rng::get_next_random(), and i.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_reproducibility2 | ) |
Definition at line 147 of file test_rng.cpp.
References rand_rng::mt_rng::get_next_random(), and i.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_reproducibility3 | ) |
Definition at line 162 of file test_rng.cpp.
References rand_rng::mt_rng::get_next_random(), rand_rng::mt_rng::get_random_calls(), rand_rng::mt_rng::get_random_seed_str(), and i.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_reproducibility4 | ) |
Definition at line 177 of file test_rng.cpp.
References rand_rng::mt_rng::get_next_random(), rand_rng::mt_rng::get_random_calls(), rand_rng::mt_rng::get_random_seed_str(), and i.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_reproducibility5 | ) |
Definition at line 195 of file test_rng.cpp.
References rand_rng::mt_rng::get_next_random(), rand_rng::mt_rng::get_random_calls(), rand_rng::mt_rng::get_random_seed_str(), and i.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_reproducibility_coverage | ) |
Definition at line 268 of file test_rng.cpp.
BOOST_AUTO_TEST_CASE | ( | validate_get_random_int | ) |
This test and the next validate that we are getting the correct values from the get_random_int function, in the class random_new.
We test both subclasses of random_new. If these tests fail but the seed manipulation tests all pass, and validate_mt19937 passes, then it suggests that the implementation of get_random_int may not be working properly on your platform.
Definition at line 304 of file test_rng.cpp.
References validation_get_random_int_correct_answer, validation_get_random_int_max, and validation_get_random_int_num_draws.
BOOST_AUTO_TEST_CASE | ( | validate_get_random_int2 | ) |
Definition at line 318 of file test_rng.cpp.
References i, validation_get_random_int_correct_answer, validation_get_random_int_max, and validation_get_random_int_num_draws.