17530
|
1 #ifndef RAND_H
|
|
2 #define RAND_H
|
|
3
|
|
4 /* Wrap srand() so that we can reproduce fuzzed tests */
|
|
5
|
|
6 /* If we have seeded the prng precisely once, and we remember what
|
|
7 * value that was with, then we can reproduce any failing test cases
|
|
8 * that depend on that randomness by forcing the seed value (e.g.
|
|
9 * in a debugger, by putting a breakpoint on rand_set_seed()).
|
|
10 */
|
|
11
|
|
12 /* Number of times we've been seeded */
|
|
13 int rand_get_seed_count(void);
|
|
14 /* That last seed */
|
|
15 unsigned int rand_get_last_seed(void);
|
|
16 /* Actually seed the prng (could add char* for name of function?) */
|
|
17 void rand_set_seed(unsigned int s);
|
|
18
|
|
19 #endif
|