The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions
test_rng.cpp File Reference
#include <boost/test/unit_test.hpp>
#include "random_new_synced.hpp"
#include "random_new_deterministic.hpp"
#include "config.hpp"
#include <sstream>
#include <iomanip>
Include dependency graph for test_rng.cpp:

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)
 

Macro Definition Documentation

#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().

Function Documentation

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  )
BOOST_AUTO_TEST_CASE ( test_mt_rng_config_seed_manip  )
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  )
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  )

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  )