You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2007/10/30 18:50:00 UTC
svn commit: r590193 - in /apr/apr-util/trunk/test: testdate.c testreslist.c
Author: trawick
Date: Tue Oct 30 10:49:59 2007
New Revision: 590193
URL: http://svn.apache.org/viewvc?rev=590193&view=rev
Log:
improve seed for sequence of random numbers
submitted by: wrowe
Modified:
apr/apr-util/trunk/test/testdate.c
apr/apr-util/trunk/test/testreslist.c
Modified: apr/apr-util/trunk/test/testdate.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/test/testdate.c?rev=590193&r1=590192&r2=590193&view=diff
==============================================================================
--- apr/apr-util/trunk/test/testdate.c (original)
+++ apr/apr-util/trunk/test/testdate.c Tue Oct 30 10:49:59 2007
@@ -158,7 +158,7 @@
#if APR_HAS_RANDOM
apr_generate_random_bytes((unsigned char *)&guess, sizeof(guess));
#else
- guess = apr_time_now() % APR_USEC_PER_SEC;
+ guess = apr_time_now() % APR_TIME_C(4294967291);
#endif
for (i = 0; i < 10000; ++i) {
Modified: apr/apr-util/trunk/test/testreslist.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/test/testreslist.c?rev=590193&r1=590192&r2=590193&view=diff
==============================================================================
--- apr/apr-util/trunk/test/testreslist.c (original)
+++ apr/apr-util/trunk/test/testreslist.c Tue Oct 30 10:49:59 2007
@@ -114,7 +114,7 @@
#if APR_HAS_RANDOM
apr_generate_random_bytes((void*)&chance, sizeof(chance));
#else
- chance = (apr_uint32_t)(apr_time_now() % APR_USEC_PER_SEC);
+ chance = (apr_uint32_t)(apr_time_now() % APR_TIME_C(4294967291));
#endif
for (i = 0; i < CONSUMER_ITERATIONS; i++) {