patch-testcode_testfasthash_cpp 780 B

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