subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1569378 - /subversion/trunk/subversion/tests/libsvn_delta/random-test.c
Date Tue, 18 Feb 2014 15:07:25 GMT
Author: brane
Date: Tue Feb 18 15:07:25 2014
New Revision: 1569378

URL: http://svn.apache.org/r1569378
Log:
Print the failing seed in random-test just like random-combine-test does.

* subversion/tests/libsvn_delta/random-test.c
  (do_random_test): Renamed from random_test. Returns the last seed used.
  (random_test): New; wrapper for do_random_test, prints seed on failure.

Modified:
    subversion/trunk/subversion/tests/libsvn_delta/random-test.c

Modified: subversion/trunk/subversion/tests/libsvn_delta/random-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_delta/random-test.c?rev=1569378&r1=1569377&r2=1569378&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_delta/random-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_delta/random-test.c Tue Feb 18 15:07:25 2014
@@ -280,9 +280,10 @@ copy_tempfile(apr_file_t *fp, apr_pool_t
 
 
 
-/* Implements svn_test_driver_t. */
+/* (Note: *LAST_SEED is an output parameter.) */
 static svn_error_t *
-random_test(apr_pool_t *pool)
+do_random_test(apr_pool_t *pool,
+               apr_uint32_t *last_seed)
 {
   apr_uint32_t seed, maxlen;
   apr_size_t bytes_range;
@@ -297,7 +298,7 @@ random_test(apr_pool_t *pool)
   for (i = 0; i < iterations; i++)
     {
       /* Generate source and target for the delta and its application.  */
-      apr_uint32_t subseed_base = svn_test_rand(&seed);
+      apr_uint32_t subseed_base = svn_test_rand((*last_seed = seed, &seed));
       apr_file_t *source = generate_random_file(maxlen, subseed_base, &seed,
                                                 random_bytes, bytes_range,
                                                 dump_files, pool);
@@ -357,6 +358,17 @@ random_test(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+/* Implements svn_test_driver_t. */
+static svn_error_t *
+random_test(apr_pool_t *pool)
+{
+  apr_uint32_t seed;
+  svn_error_t *err = do_random_test(pool, &seed);
+  if (err)
+    fprintf(stderr, "SEED: %lu\n", (unsigned long)seed);
+  return err;
+}
+
 
 
 /* (Note: *LAST_SEED is an output parameter.) */



Mime
View raw message