1 /* 2 * This is an example header file for a test. For existing tests these 3 * headers are in the library includes already, but this one is an example 4 * suitable for use as a template. 5 */ 6 7 /* 8 * The function needs a prototype. In order to use the standard test 9 * creation/destruction/execution routines, the prototype should have 10 * precisely this form. 11 */ 12 int user_template(Test **test,int irun); 13 14 /* 15 * This is default data for the test at hand. The first field is 16 * the test name. The second is the test description. The third 17 * is the default number of p-values generated by a run for display 18 * in a histogram and to generate a cumulative test p-value using 19 * Kuiper-Kolmogorov-Smirnov. The fourth is the number of "samples" 20 * accumulated per test, if relevant (some tests do not permit this 21 * to be varied). The fifth and final Dtest parameter is the number 22 * of statistics generated by the test (per test invocation) -- usually 23 * this will be one but for several it is two and could be more. 24 */ 25 static Dtest user_template_dtest __attribute__((unused)) = { 26 "Example User Test", 27 "user_template", 28 "\n\ 29 #==================================================================\n\ 30 # Example Dieharder Test\n\ 31 #\n\ 32 # Lagged Sum Test\n\ 33 # This package contains many very lovely tests. Very few of them,\n\ 34 # however, test for lagged correlations -- the possibility that\n\ 35 # the random number generator has a bitlevel correlation after\n\ 36 # some period. Diehard tests, for example, COULD NOT test for this\n\ 37 # sort of thing with only a few million rands to sample from.\n\ 38 # The template test is therefore very simple. It takes a user-\n\ 39 # specified lag (-x lag) and adds up uniform deviates sampled with\n\ 40 # that lag. The mean of tsamples samples summed should be\n\ 41 # 0.5*tsamples. The standard deviation should be sqrt(tsamples/12).\n\ 42 # The experimental values of the sum are thus converted into a\n\ 43 # p-value (using the erf()) and a ks-test applied to psamples of them.\n\ 44 #==================================================================\n", 45 100, 46 100000, 47 1, 48 user_template, 49 0 50 }; 51 52