Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /*
2 * bbsrand.c
3 *
4 * Test driver for routines in bbs_rand.h
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
13 #include <time.h>
14 #include <limits.h>
16 #include "bbs_rand.h"
18 #define NUM_TESTS 100
20 int main(void)
21 {
22 unsigned int seed, result, ix;
24 seed = time(NULL);
25 bbs_srand((unsigned char *)&seed, sizeof(seed));
27 for(ix = 0; ix < NUM_TESTS; ix++) {
28 result = bbs_rand();
30 printf("Test %3u: %08X\n", ix + 1, result);
31 }
33 return 0;
34 }