1 /*
2 * ========================================================================
3 * See copyright in copyright.h and the accompanying file COPYING
4 * ========================================================================
5 */
6
7 /*
8 * ========================================================================
9 * This program initializes a permanent internal vector of pointers to all
10 * the tests known to dieharder that generate a pvalue or vector of
11 * pvalues. With it we abandon our former addressing of tests by source
12 * (the -d, -r, -s testnumber invocation) in favor of a segmented single
13 * number. There is initial room for up to 1000 tests, but this can easily
14 * be increased.
15 *
16 * We define the ranges:
17 *
18 * 0-99 diehard (or Marsaglia & Tsang) based tests.
19 * 100-199 the NIST STS
20 * 200-499 everything else.
21 * 500-999 reserved for future sets of "named" tests if it seems
22 * reasonable to use it that way, or straight expansion
23 * space otherwise. 500 tests will hold us for a while...
24 *
25 * ========================================================================
26 */
27
28 #include <dieharder/libdieharder.h>
29
dieharder_test_types()30 void dieharder_test_types()
31 {
32
33 int i;
34
35 /*
36 * Null the whole thing for starters
37 */
38 for(i=0;i<MAXTESTS;i++) dh_test_types[i] = 0;
39
40 /*
41 * Copy its contents over into dieharder_rng_generator_types.
42 */
43 i = 0;
44 dh_num_diehard_tests = 0;
45
46 ADD_TEST(&diehard_birthdays_dtest);
47 dh_num_diehard_tests++;
48
49 ADD_TEST(&diehard_operm5_dtest);
50 dh_num_diehard_tests++;
51
52 ADD_TEST(&diehard_rank_32x32_dtest);
53 dh_num_diehard_tests++;
54
55 ADD_TEST(&diehard_rank_6x8_dtest);
56 dh_num_diehard_tests++;
57
58 ADD_TEST(&diehard_bitstream_dtest);
59 dh_num_diehard_tests++;
60
61 ADD_TEST(&diehard_opso_dtest);
62 dh_num_diehard_tests++;
63
64 ADD_TEST(&diehard_oqso_dtest);
65 dh_num_diehard_tests++;
66
67 ADD_TEST(&diehard_dna_dtest);
68 dh_num_diehard_tests++;
69
70 ADD_TEST(&diehard_count_1s_stream_dtest);
71 dh_num_diehard_tests++;
72
73 ADD_TEST(&diehard_count_1s_byte_dtest);
74 dh_num_diehard_tests++;
75
76 ADD_TEST(&diehard_parking_lot_dtest);
77 dh_num_diehard_tests++;
78
79 ADD_TEST(&diehard_2dsphere_dtest);
80 dh_num_diehard_tests++;
81
82 ADD_TEST(&diehard_3dsphere_dtest);
83 dh_num_diehard_tests++;
84
85 ADD_TEST(&diehard_squeeze_dtest);
86 dh_num_diehard_tests++;
87
88 ADD_TEST(&diehard_sums_dtest);
89 dh_num_diehard_tests++;
90
91 ADD_TEST(&diehard_runs_dtest);
92 dh_num_diehard_tests++;
93
94 ADD_TEST(&diehard_craps_dtest);
95 dh_num_diehard_tests++;
96
97 ADD_TEST(&marsaglia_tsang_gcd_dtest);
98 dh_num_diehard_tests++;
99
100 MYDEBUG(D_TYPES){
101 printf("# dieharder_test_types(): Found %u diehard tests.\n",dh_num_diehard_tests);
102 }
103
104 /*
105 * Next, it is about time to add the first sts tests.
106 */
107 i = 100;
108 ADD_TEST(&sts_monobit_dtest);
109 dh_num_sts_tests++;
110
111 ADD_TEST(&sts_runs_dtest);
112 dh_num_sts_tests++;
113
114 ADD_TEST(&sts_serial_dtest);
115 dh_num_sts_tests++;
116
117 /*
118 * Finally, from here on we add the "rgb" tests, only they aren't,
119 * really -- this is where all new non-diehard, non-sts tests will
120 * go. So we call them "other" tests.
121 */
122 i = 200;
123 ADD_TEST(&rgb_bitdist_dtest);
124 dh_num_other_tests++;
125
126 ADD_TEST(&rgb_minimum_distance_dtest);
127 dh_num_other_tests++;
128
129 ADD_TEST(&rgb_permutations_dtest);
130 dh_num_other_tests++;
131
132 ADD_TEST(&rgb_lagged_sums_dtest);
133 dh_num_other_tests++;
134
135 ADD_TEST(&rgb_kstest_test_dtest);
136 dh_num_other_tests++;
137
138 ADD_TEST(&dab_bytedistrib_dtest);
139 dh_num_other_tests++;
140
141 ADD_TEST(&dab_dct_dtest);
142 dh_num_other_tests++;
143
144 ADD_TEST(&dab_filltree_dtest);
145 dh_num_other_tests++;
146
147 ADD_TEST(&dab_filltree2_dtest);
148 dh_num_other_tests++;
149
150 ADD_TEST(&dab_monobit2_dtest);
151 dh_num_other_tests++;
152
153 /*
154 * This is the total number of DOCUMENTED tests reported back to the
155 * UIs. Note that dh_num_user_tests is counted up by add_ui_tests(),
156 * which also sets this variable (so they can be called in either
157 * order).
158 */
159 dh_num_tests = dh_num_diehard_tests + dh_num_sts_tests + dh_num_other_tests
160 + dh_num_user_tests;
161
162 /*
163 * Except that clever old me will put an undocumented test range out here
164 * at 900 reserved for development! We move them back down to 200+
165 * if/when we are ready to release them. They are not looped over by
166 * run_all_tests() but can of course be directly invoked by hand.
167 */
168 i = 900;
169
170 /* ADD_TEST(&rgb_operm_dtest); */
171 /* dh_num_other_tests++; */
172
173 /* ADD_TEST(&rgb_lmn_dtest); */
174 /* dh_num_other_tests++; */
175
176
177
178 }
179
180