#include <boost/test/unit_test.hpp>
#include "random_synced.hpp"
#include "random_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. More... | |
BOOST_AUTO_TEST_CASE (validate_get_random_int2) | |
#define GETTEXT_DOMAIN "wesnoth-test" |
Definition at line 16 of file test_rng.cpp.
#define validation_get_random_int_correct_answer 10885 |
Definition at line 296 of file test_rng.cpp.
#define validation_get_random_int_max 32000 |
Definition at line 294 of file test_rng.cpp.
#define validation_get_random_int_num_draws 19999 |
Definition at line 292 of file test_rng.cpp.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_config_seed_manip | ) |
Definition at line 85 of file test_rng.cpp.
References randomness::mt_rng::get_random_seed(), randomness::mt_rng::get_random_seed_str(), and randomness::mt_rng::seed_random().
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_reproducibility | ) |
Definition at line 134 of file test_rng.cpp.
References randomness::mt_rng::get_next_random(), and i.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_reproducibility2 | ) |
Definition at line 149 of file test_rng.cpp.
References randomness::mt_rng::get_next_random(), and i.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_reproducibility3 | ) |
Definition at line 164 of file test_rng.cpp.
References randomness::mt_rng::get_next_random(), randomness::mt_rng::get_random_calls(), randomness::mt_rng::get_random_seed_str(), and i.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_reproducibility4 | ) |
Definition at line 179 of file test_rng.cpp.
References randomness::mt_rng::get_next_random(), randomness::mt_rng::get_random_calls(), randomness::mt_rng::get_random_seed_str(), and i.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_reproducibility5 | ) |
Definition at line 197 of file test_rng.cpp.
References randomness::mt_rng::get_next_random(), randomness::mt_rng::get_random_calls(), randomness::mt_rng::get_random_seed_str(), and i.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_reproducibility_coverage | ) |
Definition at line 270 of file test_rng.cpp.
BOOST_AUTO_TEST_CASE | ( | test_mt_rng_seed_manip | ) |
Definition at line 42 of file test_rng.cpp.
References randomness::mt_rng::get_random_seed(), randomness::mt_rng::get_random_seed_str(), and randomness::mt_rng::seed_random().
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.
We test both subclasses of random. 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 306 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 320 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.
BOOST_AUTO_TEST_CASE | ( | validate_mt19937 | ) |
Definition at line 30 of file test_rng.cpp.
References i.