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.
michael@0 | 1 | /* |
michael@0 | 2 | * bbsrand.c |
michael@0 | 3 | * |
michael@0 | 4 | * Test driver for routines in bbs_rand.h |
michael@0 | 5 | * |
michael@0 | 6 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 7 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 9 | |
michael@0 | 10 | #include <stdio.h> |
michael@0 | 11 | #include <stdlib.h> |
michael@0 | 12 | #include <string.h> |
michael@0 | 13 | #include <time.h> |
michael@0 | 14 | #include <limits.h> |
michael@0 | 15 | |
michael@0 | 16 | #include "bbs_rand.h" |
michael@0 | 17 | |
michael@0 | 18 | #define NUM_TESTS 100 |
michael@0 | 19 | |
michael@0 | 20 | int main(void) |
michael@0 | 21 | { |
michael@0 | 22 | unsigned int seed, result, ix; |
michael@0 | 23 | |
michael@0 | 24 | seed = time(NULL); |
michael@0 | 25 | bbs_srand((unsigned char *)&seed, sizeof(seed)); |
michael@0 | 26 | |
michael@0 | 27 | for(ix = 0; ix < NUM_TESTS; ix++) { |
michael@0 | 28 | result = bbs_rand(); |
michael@0 | 29 | |
michael@0 | 30 | printf("Test %3u: %08X\n", ix + 1, result); |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | return 0; |
michael@0 | 34 | } |