8000 ENH: Add an ad hoc option to just do the Pat5 tests. · rkern/PractRand093-fork@b3f02ee · GitHub
[go: up one dir, main page]

Skip to content

Commit b3f02ee

Browse files
committed
ENH: Add an ad hoc option to just do the Pat5 tests.
This is an attempt to more quickly replicate the failure observed in sfc64: https://sourceforge.net/p/pracrand/discussion/366935/thread/aa4fb292/#bdc3 ``` ./RNG_test sfc64 -te 2 -tlmin 30 -tlmax 50 -seed 0xdf7e5fd0802274af ```
1 parent 671233d commit b3f02ee

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

include/PractRand/test_batteries.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ namespace PractRand {
5555
//no data transformations
5656
ListOfTests get_expanded_core_tests();
5757

58+
//just Pat5
59+
//no data transformations
60+
ListOfTests get_pat5_tests();
61+
5862
//extra tests
5963
//recommended data transformations
6064
//(which data transforms are recommended is a function of RNG metadata)

src/test_batteries.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ namespace PractRand {
150150
NULL
151151
);
152152
}
153+
ListOfTests get_pat5_tests() {
154+
return Tests::ListOfTests(
155+
new Tests::Pat5(),
156+
NULL
157+
);
158+
}
153159
ListOfTests get_expanded_standard_tests(const RNGs::vRNG *rng) {
154160
return apply_standard_foldings(rng, get_expanded_core_tests);
155161
}

tools/RNG_test.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ int main(int argc, char **argv) {
799799
else if (!std::strcmp(argv[i], "-te")) {
800800
if (params_left < 1) {std::printf("command line option %s must be followed by a value\n", argv[i]); std::exit(0);}
801801
expanded = std::atoi(argv[++i]);
802-
if (expanded < 0 || expanded > 1) {
802+
if (expanded < 0 || expanded > 2) {
803803
std::printf("invalid expanded test set value: -te %s\n", argv[i]);
804804
std::exit(0);
805805
}
@@ -939,7 +939,7 @@ int main(int argc, char **argv) {
939939
std::printf("RNG = %s, seed = 0x", testing_rng->get_name().c_str());
940940
if (seed >> 32) std::printf("%lx%08lx", long(seed >> 32), long((seed << 32) >> 32));
941941
else std::printf("%lx", long(seed));
942-
const char *test_set_names[2] = {"normal", "expanded"};
942+
const char *test_set_names[3] = {"normal", "expanded", "pat5"};
943943
const char *folding_names[3] = {"none", "standard", "extra"};
944944
std::printf("\ntest set = %s, folding = %s", test_set_names[expanded], folding_names[folding]);
945945
if (folding == 1) {
@@ -956,6 +956,8 @@ int main(int argc, char **argv) {
956956
// 5.6 GB / minute -- core = basic tests only, no folding
957957
else if (folding == 0 && expanded == 0) tests = Tests::Batteries::get_core_tests();
958958

959+
else if (folding == 1 && expanded == 2) tests = Tests::Batteries::get_pat5_tests();
960+
959961
// 4.4 GB / minute -- standard = basic tests, smart folding
960962
else if (folding == 1 && expanded == 0) tests = Tests::Batteries::get_standard_tests(testing_rng);
961963

0 commit comments

Comments
 (0)
0