This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <config.h>
18
19 #include <stdlib.h>
20
21 #include "signature.h"
22 SIGNATURE_CHECK (srandom, void, (unsigned int));
23 SIGNATURE_CHECK (initstate, char *, (unsigned int, char *, size_t));
24 SIGNATURE_CHECK (setstate, char *, (char *));
25 SIGNATURE_CHECK (random, long, (void));
26
27 #include <time.h>
28
29 #include "macros.h"
30
31 int
32 main ()
33 {
34 char buf[128];
35 unsigned int i;
36 unsigned int n_big = 0;
37
38 initstate (time (NULL), buf, sizeof buf);
39 for (i = 0; i < 1000; i++)
40 {
41 long r = random ();
42 ASSERT (0 <= r);
43 if (RAND_MAX / 2 < r)
44 ++n_big;
45 }
46
47
48 return !n_big;
49 }