1234567891011121314151617181920212223 |
- $OpenBSD: patch-testcode_testfasthash_cpp,v 1.1 2013/12/24 13:57:18 sthen Exp $
- --- testcode/testfasthash.cpp.orig Sun Jun 23 20:45:16 2013
- +++ testcode/testfasthash.cpp Sat Dec 21 15:08:08 2013
- @@ -233,11 +233,18 @@ HRESULT CTestFastHash::TestRemove()
- }
-
- // shuffle our array - this is the order in which we'll do removes
- +#ifndef HAVE_ARC4RANDOM
- srand(99);
- +#endif
- for (size_t x = 0; x < c_maxsize; x++)
- {
- +#ifdef HAVE_ARC4RANDOM
- + int firstindex = arc4random_uniform(c_maxsize);
- + int secondindex = arc4random_uniform(c_maxsize);
- +#else
- int firstindex = rand() % c_maxsize;
- int secondindex = rand() % c_maxsize;
- +#endif
-
- int val1 = tracking[firstindex];
- int val2 = tracking[secondindex];
|