subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1476725 - in /subversion/trunk/subversion/tests/libsvn_delta: random-test.c range-index-test.h
Date Sun, 28 Apr 2013 07:23:22 GMT
Author: brane
Date: Sun Apr 28 07:23:22 2013
New Revision: 1476725

URL: http://svn.apache.org/r1476725
Log:
Update the range-index-test (which is a mostly unused part of random-test)
to use the same types as the range_index_node_t.

* subversion/tests/libsvn_delta/range-index-test.h: Use apr_size_t and
   APR_SIZE_T_FMT instead of apr_off_t and APR_OFF_T_FMT. Adjust bits of
   code to account for the type now being unsigned.

* subversion/tests/libsvn_delta/random-test.c (random_combine_test):
   Make debugging random-test easier by printing the random seed that
   caused the the test to fail.

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

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=1476725&r1=1476724&r2=1476725&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_delta/random-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_delta/random-test.c Sun Apr 28 07:23:22 2013
@@ -500,6 +500,8 @@ random_combine_test(apr_pool_t *pool)
 {
   apr_uint32_t seed;
   svn_error_t *err = do_random_combine_test(pool, &seed);
+  if (err)
+    fprintf(stderr, "SEED: %lu\n", (unsigned long)seed);
   return err;
 }
 

Modified: subversion/trunk/subversion/tests/libsvn_delta/range-index-test.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_delta/range-index-test.h?rev=1476725&r1=1476724&r2=1476725&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_delta/range-index-test.h (original)
+++ subversion/trunk/subversion/tests/libsvn_delta/range-index-test.h Sun Apr 28 07:23:22
2013
@@ -27,7 +27,7 @@
 #include "../../libsvn_delta/compose_delta.c"
 
 static range_index_node_t *prev_node, *prev_prev_node;
-static apr_off_t
+static apr_size_t
 walk_range_index(range_index_node_t *node, const char **msg)
 {
   apr_off_t ret;
@@ -70,19 +70,18 @@ print_node_data(range_index_node_t *node
 {
   if (-node->target_offset == ndx)
     {
-      printf("   * Node: [%3"APR_OFF_T_FMT
-             ",%3"APR_OFF_T_FMT
-             ") = %-5"APR_OFF_T_FMT"%s\n",
+      printf("   * Node: [%3"APR_SIZE_T_FMT
+             ",%3"APR_SIZE_T_FMT
+             ") = %-5"APR_SIZE_T_FMT"%s\n",
              node->offset, node->limit, -node->target_offset, msg);
     }
   else
     {
-      printf("     Node: [%3"APR_OFF_T_FMT
-             ",%3"APR_OFF_T_FMT
-             ") = %"APR_OFF_T_FMT"\n",
+      printf("     Node: [%3"APR_SIZE_T_FMT
+             ",%3"APR_SIZE_T_FMT
+             ") = %"APR_SIZE_T_FMT"\n",
              node->offset, node->limit,
-             (node->target_offset < 0
-              ? -node->target_offset : node->target_offset));
+             node->target_offset);
     }
 }
 
@@ -154,13 +153,13 @@ random_range_index_test(apr_pool_t *pool
   ndx = create_range_index(pool);
   for (i = 1; i <= iterations; ++i)
     {
-      apr_off_t offset = svn_test_rand(&seed) % 47;
-      apr_off_t limit = offset + svn_test_rand(&seed) % 16 + 1;
+      apr_size_t offset = svn_test_rand(&seed) % 47;
+      apr_size_t limit = offset + svn_test_rand(&seed) % 16 + 1;
       range_list_node_t *list, *r;
-      apr_off_t ret;
+      apr_size_t ret;
       const char *msg2;
 
-      printf("%3d: Inserting [%3"APR_OFF_T_FMT",%3"APR_OFF_T_FMT") ...",
+      printf("%3d: Inserting [%3"APR_SIZE_T_FMT",%3"APR_SIZE_T_FMT") ...",
              i, offset, limit);
       splay_range_index(offset, ndx);
       list = build_range_list(offset, limit, ndx);
@@ -170,7 +169,7 @@ random_range_index_test(apr_pool_t *pool
       if (ret == 0)
         {
           for (r = list; r; r = r->next)
-            printf(" %s[%3"APR_OFF_T_FMT",%3"APR_OFF_T_FMT")",
+            printf(" %s[%3"APR_SIZE_T_FMT",%3"APR_SIZE_T_FMT")",
                    (r->kind == range_from_source ?
                     (++src_cp, "S") : (++tgt_cp, "T")),
                    r->offset, r->limit);



Mime
View raw message