You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2004/11/21 13:32:34 UTC

svn commit: r106082 - /apr/apr/branches/0.9.x/test/testrand.c

Author: jorton
Date: Sun Nov 21 04:32:33 2004
New Revision: 106082

Modified:
   apr/apr/branches/0.9.x/test/testrand.c
Log:
Merge r64682 from trunk:

* test/testrand.c (rand_exists): Don't ask for so much random
data.



Modified: apr/apr/branches/0.9.x/test/testrand.c
==============================================================================
--- apr/apr/branches/0.9.x/test/testrand.c	(original)
+++ apr/apr/branches/0.9.x/test/testrand.c	Sun Nov 21 04:32:33 2004
@@ -24,17 +24,13 @@
 #if !APR_HAS_RANDOM
     CuNotImpl(tc, "apr_generate_random_bytes");
 #else
-    apr_status_t rv;
-    unsigned char c[2048];
-    int i;
+    unsigned char c[42];
 
     /* There must be a better way to test random-ness, but I don't know
      * what it is right now.
      */
-    for (i = 1; i <= 8; i++) {
-        rv = apr_generate_random_bytes(c, i * 255);
-        apr_assert_success(tc, "apr_generate_random_bytes failed", rv);
-    }
+    apr_assert_success(tc, "apr_generate_random_bytes failed",
+                       apr_generate_random_bytes(c, sizeof c));
 #endif
 }