subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1546002 [35/39] - in /subversion/branches/verify-keep-going: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ build/win32/ contrib/client-side/emacs/ contrib/server-side/ contrib/server-side/svnc...
Date Wed, 27 Nov 2013 11:52:46 GMT
Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/error-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/error-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/error-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/error-test.c Wed Nov 27 11:52:35 2013
@@ -229,6 +229,8 @@ test_error_symbolic_name(apr_pool_t *poo
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/hashdump-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/hashdump-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/hashdump-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/hashdump-test.c Wed Nov 27 11:52:35 2013
@@ -31,6 +31,7 @@
 
 #include "../svn_test.h"
 
+#include "svn_private_config.h"
 #include "svn_types.h"
 #include "svn_string.h"
 #include "svn_error.h"
@@ -177,6 +178,9 @@ test3(apr_pool_t *pool)
 */
 
 /* An array of all test functions */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/io-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/io-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/io-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/io-test.c Wed Nov 27 11:52:35 2013
@@ -26,10 +26,12 @@
 #include <stdio.h>
 
 #include <apr.h>
+#include <apr_version.h>
 
 #include "svn_pools.h"
 #include "svn_string.h"
 #include "private/svn_skel.h"
+#include "private/svn_dep_compat.h"
 
 #include "../svn_test.h"
 #include "../svn_test_fs.h"
@@ -37,7 +39,7 @@
 
 /* Helpers to create the test data directory. */
 
-#define TEST_DIR "io-test-temp"
+#define TEST_DIR_PREFIX "io-test-temp"
 
 /* The definition for the test data files. */
 struct test_file_definition_t
@@ -64,7 +66,7 @@ struct test_file_definition_t
     char* created_path;
   };
 
-struct test_file_definition_t test_file_definitions[] =
+struct test_file_definition_t test_file_definitions_template[] =
   {
     {"empty",                 "",      0},
     {"single_a",              "a",     1},
@@ -119,6 +121,7 @@ struct test_file_definition_t test_file_
 
 static svn_error_t *
 create_test_file(struct test_file_definition_t* definition,
+                 const char *testname,
                  apr_pool_t *pool,
                  apr_pool_t *scratch_pool)
 {
@@ -127,6 +130,7 @@ create_test_file(struct test_file_defini
   apr_off_t midpos = definition->size / 2;
   svn_error_t *err = NULL;
   int i;
+  const char *test_dir = apr_pstrcat(pool, TEST_DIR_PREFIX, testname, NULL);
 
   if (definition->size < 5)
     SVN_ERR_ASSERT(strlen(definition->data) >= (apr_size_t)definition->size);
@@ -134,9 +138,9 @@ create_test_file(struct test_file_defini
     SVN_ERR_ASSERT(strlen(definition->data) >= 5);
 
 
-  definition->created_path = svn_dirent_join(TEST_DIR,
-                                  definition->name,
-                                  pool);
+  definition->created_path = svn_dirent_join(test_dir,
+                                             definition->name,
+                                             pool);
 
   SVN_ERR(svn_io_file_open(&file_h,
                            definition->created_path,
@@ -174,37 +178,47 @@ create_test_file(struct test_file_defini
 
 /* Function to prepare the whole set of on-disk files to be compared. */
 static svn_error_t *
-create_comparison_candidates(apr_pool_t *scratch_pool)
+create_comparison_candidates(struct test_file_definition_t **definitions,
+                             const char *testname,
+                             apr_pool_t *pool)
 {
   svn_node_kind_t kind;
-  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  apr_pool_t *iterpool = svn_pool_create(pool);
   struct test_file_definition_t *candidate;
   svn_error_t *err = SVN_NO_ERROR;
+  apr_size_t count = 0;
+  const char *test_dir = apr_pstrcat(pool, TEST_DIR_PREFIX,
+                                     testname, NULL);
 
   /* If there's already a directory named io-test-temp, delete it.
      Doing things this way means that repositories stick around after
      a failure for postmortem analysis, but also that tests can be
      re-run without cleaning out the repositories created by prior
      runs.  */
-  SVN_ERR(svn_io_check_path(TEST_DIR, &kind, scratch_pool));
+  SVN_ERR(svn_io_check_path(test_dir, &kind, pool));
 
   if (kind == svn_node_dir)
-    SVN_ERR(svn_io_remove_dir2(TEST_DIR, TRUE, NULL, NULL, scratch_pool));
+    SVN_ERR(svn_io_remove_dir2(test_dir, TRUE, NULL, NULL, pool));
   else if (kind != svn_node_none)
     return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
                              "There is already a file named '%s'",
-                             TEST_DIR);
+                             test_dir);
 
-  SVN_ERR(svn_io_dir_make(TEST_DIR, APR_OS_DEFAULT, scratch_pool));
+  SVN_ERR(svn_io_dir_make(test_dir, APR_OS_DEFAULT, pool));
 
-  svn_test_add_dir_cleanup(TEST_DIR);
+  svn_test_add_dir_cleanup(test_dir);
 
-  for (candidate = test_file_definitions;
+  for (candidate = test_file_definitions_template;
        candidate->name != NULL;
        candidate += 1)
+    count++;
+
+  *definitions = apr_pmemdup(pool, test_file_definitions_template,
+                             (count + 1) * sizeof(**definitions));
+  for (candidate = *definitions; candidate->name != NULL; candidate += 1)
     {
       svn_pool_clear(iterpool);
-      err = create_test_file(candidate, scratch_pool, iterpool);
+      err = create_test_file(candidate, testname, pool, iterpool);
       if (err)
         break;
     }
@@ -227,8 +241,11 @@ test_two_file_size_comparison(apr_pool_t
   svn_error_t *err = SVN_NO_ERROR;
   svn_error_t *cmp_err;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  struct test_file_definition_t *test_file_definitions;
 
-  SVN_ERR(create_comparison_candidates(scratch_pool));
+  SVN_ERR(create_comparison_candidates(&test_file_definitions,
+                                       "test_two_file_size_comparison",
+                                       scratch_pool));
 
   for (outer = test_file_definitions; outer->name != NULL; outer += 1)
     {
@@ -278,8 +295,11 @@ test_two_file_content_comparison(apr_poo
   svn_error_t *err = SVN_NO_ERROR;
   svn_error_t *cmp_err;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  struct test_file_definition_t *test_file_definitions;
 
-  SVN_ERR(create_comparison_candidates(scratch_pool));
+  SVN_ERR(create_comparison_candidates(&test_file_definitions,
+                                       "test_two_file_content_comparison",
+                                       scratch_pool));
 
   for (outer = test_file_definitions; outer->name != NULL; outer += 1)
     {
@@ -331,8 +351,11 @@ test_three_file_size_comparison(apr_pool
   svn_error_t *err = SVN_NO_ERROR;
   svn_error_t *cmp_err;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  struct test_file_definition_t *test_file_definitions;
 
-  SVN_ERR(create_comparison_candidates(scratch_pool));
+  SVN_ERR(create_comparison_candidates(&test_file_definitions,
+                                       "test_three_file_size_comparison",
+                                       scratch_pool));
 
   for (outer = test_file_definitions; outer->name != NULL; outer += 1)
     {
@@ -411,8 +434,11 @@ test_three_file_content_comparison(apr_p
   svn_error_t *err = SVN_NO_ERROR;
   svn_error_t *cmp_err;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  struct test_file_definition_t *test_file_definitions;
 
-  SVN_ERR(create_comparison_candidates(scratch_pool));
+  SVN_ERR(create_comparison_candidates(&test_file_definitions,
+                                       "test_three_file_content_comparison",
+                                       scratch_pool));
 
   for (outer = test_file_definitions; outer->name != NULL; outer += 1)
     {
@@ -507,9 +533,141 @@ read_length_line_shouldnt_loop(apr_pool_
   return SVN_NO_ERROR;
 }
 
+/* Move the read pointer in FILE to absolute position OFFSET and align
+ * the read buffer to multiples of BLOCK_SIZE.  Use POOL for allocations.
+ */
+static svn_error_t *
+aligned_seek(apr_file_t *file,
+             apr_size_t block_size,
+             apr_size_t offset,
+             apr_pool_t *pool)
+{
+  apr_off_t block_start;
+  apr_off_t current;
+
+  SVN_ERR(svn_io_file_aligned_seek(file, (apr_off_t)block_size,
+                                   &block_start, (apr_off_t)offset, pool));
+
+  /* block start shall be aligned to multiples of block_size.
+     If it isn't, it must be aligned to APR's default block size(pre-1.3 APR)
+   */
+#if APR_VERSION_AT_LEAST(1,3,0)
+  SVN_TEST_ASSERT(block_start % block_size == 0);
+  SVN_TEST_ASSERT(offset - block_start < block_size);
+#else
+  SVN_TEST_ASSERT(block_start % 0x1000 == 0);
+  SVN_TEST_ASSERT(offset - block_start < 0x1000);
+#endif
+
+  /* we must be at the desired offset */
+  current = 0;
+  SVN_ERR(svn_io_file_seek(file, SEEK_CUR, &current, pool));
+  SVN_TEST_ASSERT(current == (apr_off_t)offset);
+
+  return SVN_NO_ERROR;
+}
+
+/* Move the read pointer in FILE to absolute position OFFSET, align the
+ * read buffer to multiples of BLOCK_SIZE and read one byte from that
+ * position.  Verify that it matches the CONTENTS for that offset.
+ * Use POOL for allocations.
+ */
+static svn_error_t *
+aligned_read_at(apr_file_t *file,
+                svn_stringbuf_t *contents,
+                apr_size_t block_size,
+                apr_size_t offset,
+                apr_pool_t *pool)
+{
+  char c;
+  SVN_ERR(aligned_seek(file, block_size, offset,pool));
+
+  /* the data we read must match whatever we wrote there */
+  SVN_ERR(svn_io_file_getc(&c, file, pool));
+  SVN_TEST_ASSERT(c == contents->data[offset]);
+
+  return SVN_NO_ERROR;
+}
+
+/* Verify that aligned seek with the given BLOCK_SIZE works for FILE.
+ * CONTENTS is the data expected from FILE.  Use POOL for allocations.
+ */
+static svn_error_t *
+aligned_read(apr_file_t *file,
+             svn_stringbuf_t *contents,
+             apr_size_t block_size,
+             apr_pool_t *pool)
+{
+  apr_size_t i;
+  apr_size_t offset = 0;
+  const apr_size_t prime = 78427;
+
+  /* "random" access to different offsets */
+  for (i = 0, offset = prime; i < 10; ++i, offset += prime)
+    SVN_ERR(aligned_read_at(file, contents, block_size,
+                            offset % contents->len, pool));
+
+  /* we can seek to EOF */
+  SVN_ERR(aligned_seek(file, contents->len, block_size, pool));
+
+  /* reversed order access to all bytes */
+  for (i = contents->len; i > 0; --i)
+    SVN_ERR(aligned_read_at(file, contents, block_size, i - 1, pool));
+
+  /* forward order access to all bytes */
+  for (i = 0; i < contents->len; ++i)
+    SVN_ERR(aligned_read_at(file, contents, block_size, i, pool));
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+aligned_seek_test(apr_pool_t *pool)
+{
+  apr_size_t i;
+  const char *tmp_dir;
+  const char *tmp_file;
+  apr_file_t *f;
+  svn_stringbuf_t *contents;
+  const apr_size_t file_size = 100000;
+
+  /* create a temp folder & schedule it for automatic cleanup */
+
+  SVN_ERR(svn_dirent_get_absolute(&tmp_dir, "aligned_seek_tmp", pool));
+  SVN_ERR(svn_io_remove_dir2(tmp_dir, TRUE, NULL, NULL, pool));
+  SVN_ERR(svn_io_make_dir_recursively(tmp_dir, pool));
+  svn_test_add_dir_cleanup(tmp_dir);
+
+  /* create a temp file with know contents */
+
+  contents = svn_stringbuf_create_ensure(file_size, pool);
+  for (i = 0; i < file_size; ++i)
+    svn_stringbuf_appendbyte(contents, (char)rand());
+
+  SVN_ERR(svn_io_write_unique(&tmp_file, tmp_dir, contents->data,
+                              contents->len,
+                              svn_io_file_del_on_pool_cleanup, pool));
+
+  /* now, access read data with varying alignment sizes */
+  SVN_ERR(svn_io_file_open(&f, tmp_file, APR_READ | APR_BUFFERED,
+                           APR_OS_DEFAULT, pool));
+  SVN_ERR(aligned_read(f, contents,   0x1000, pool)); /* APR default */
+  SVN_ERR(aligned_read(f, contents,   0x8000, pool)); /* "unusual" 32K */
+  SVN_ERR(aligned_read(f, contents,  0x10000, pool)); /* FSX default */
+  SVN_ERR(aligned_read(f, contents, 0x100000, pool)); /* larger than file */
+  SVN_ERR(aligned_read(f, contents,    10001, pool)); /* odd, larger than
+                                                         APR default */
+  SVN_ERR(aligned_read(f, contents,     1003, pool)); /* odd, smaller than
+                                                         APR default */
+
+  return SVN_NO_ERROR;
+}
+
 
 /* The test table.  */
 
+int svn_test_max_threads = 3;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,
@@ -523,5 +681,7 @@ struct svn_test_descriptor_t test_funcs[
                    "three file content comparison"),
     SVN_TEST_PASS2(read_length_line_shouldnt_loop,
                    "svn_io_read_length_line() shouldn't loop"),
+    SVN_TEST_PASS2(aligned_seek_test,
+                   "test aligned seek"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/mergeinfo-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/mergeinfo-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/mergeinfo-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/mergeinfo-test.c Wed Nov 27 11:52:35 2013
@@ -28,6 +28,7 @@
 
 #define SVN_DEPRECATED
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_types.h"
@@ -114,10 +115,6 @@ verify_mergeinfo_parse(const char *input
 }
 
 
-/* Some of our own global variables (for simplicity), which map paths
-   -> merge ranges. */
-static apr_hash_t *info1, *info2;
-
 #define NBR_MERGEINFO_VALS 24
 
 /* Valid mergeinfo values. */
@@ -268,6 +265,7 @@ test_parse_combine_rangeinfo(apr_pool_t 
 {
   apr_array_header_t *result;
   svn_merge_range_t *resultrange;
+  apr_hash_t *info1;
 
   SVN_ERR(svn_mergeinfo_parse(&info1, single_mergeinfo, pool));
 
@@ -346,6 +344,7 @@ test_parse_broken_mergeinfo(apr_pool_t *
 {
   int i;
   svn_error_t *err;
+  apr_hash_t *info1;
 
   /* Trigger some error(s) with mal-formed input. */
   for (i = 0; i < NBR_BROKEN_MERGEINFO_VALS; i++)
@@ -565,6 +564,7 @@ test_mergeinfo_intersect(apr_pool_t *poo
     { {0, 1, TRUE}, {2, 4, TRUE}, {11, 12, TRUE} };
   svn_rangelist_t *rangelist;
   apr_hash_t *intersection;
+  apr_hash_t *info1, *info2;
 
   SVN_ERR(svn_mergeinfo_parse(&info1, "/trunk: 1-6,12-16\n/foo: 31", pool));
   SVN_ERR(svn_mergeinfo_parse(&info2, "/trunk: 1,3-4,7,9,11-12", pool));
@@ -701,6 +701,7 @@ test_merge_mergeinfo(apr_pool_t *pool)
     {
       int j;
       svn_string_t *info2_starting, *info2_ending;
+      apr_hash_t *info1, *info2;
 
       SVN_ERR(svn_mergeinfo_parse(&info1, mergeinfo[i].mergeinfo1, pool));
       SVN_ERR(svn_mergeinfo_parse(&info2, mergeinfo[i].mergeinfo2, pool));
@@ -1109,6 +1110,7 @@ test_rangelist_to_string(apr_pool_t *poo
   svn_rangelist_t *result;
   svn_string_t *output;
   svn_string_t *expected = svn_string_create("3,5,7-11,13-14", pool);
+  apr_hash_t *info1;
 
   SVN_ERR(svn_mergeinfo_parse(&info1, mergeinfo1, pool));
 
@@ -1129,6 +1131,7 @@ test_mergeinfo_to_string(apr_pool_t *poo
 {
   svn_string_t *output;
   svn_string_t *expected;
+  apr_hash_t *info1, *info2;
   expected = svn_string_create("/fred:8-10\n/trunk:3,5,7-11,13-14", pool);
 
   SVN_ERR(svn_mergeinfo_parse(&info1, mergeinfo1, pool));
@@ -1670,6 +1673,8 @@ test_remove_prefix_from_catalog(apr_pool
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/named_atomic-test-common.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/named_atomic-test-common.h?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/named_atomic-test-common.h (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/named_atomic-test-common.h Wed Nov 27 11:52:35 2013
@@ -209,7 +209,7 @@ test_pipeline(int id, int count, int ite
                                             ATOMIC_NAME,
                                             apr_itoa(pool,
                                                      id),
-                                            NULL),
+                                            SVN_VA_NULL),
                                 FALSE));
   SVN_ERR(svn_named_atomic__get(&atomic_out,
                                 ns,
@@ -217,7 +217,7 @@ test_pipeline(int id, int count, int ite
                                             ATOMIC_NAME,
                                             apr_itoa(pool,
                                                      (id + 1) % count),
-                                            NULL),
+                                            SVN_VA_NULL),
                                 FALSE));
 
   /* our iteration counter */

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/named_atomic-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/named_atomic-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/named_atomic-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/named_atomic-test.c Wed Nov 27 11:52:35 2013
@@ -57,7 +57,7 @@ adjust_proc_path(const char **proc, cons
   char path [MAX_PATH] = { 0 };
   GetModuleFileNameA(NULL, path, sizeof(path));
   *(strrchr(path, '\\') + 1) = 0;
-  *proc = apr_pstrcat(pool, path, *proc, ".exe", NULL);
+  *proc = apr_pstrcat(pool, path, *proc, ".exe", SVN_VA_NULL);
 
   /* And we need to set the working dir to our working dir to make
    * our sub-processes find all DLLs. */
@@ -215,7 +215,7 @@ init_concurrency_test_shm(apr_pool_t *po
                                     apr_pstrcat(pool,
                                                 ATOMIC_NAME,
                                                 apr_itoa(pool, i),
-                                                NULL),
+                                                SVN_VA_NULL),
                                     TRUE));
       SVN_ERR(svn_named_atomic__write(NULL, 0, atomic));
     }
@@ -390,9 +390,9 @@ calibrate_iterations(apr_pool_t *pool, i
   int calib_iterations;
   double taken = 0.0;
 
-  /* increase iterations until we pass the 100ms mark */
+  /* increase iterations until we pass the 20ms mark */
 
-  for (calib_iterations = 10; taken < 100000.0; calib_iterations *= 2)
+  for (calib_iterations = 10; taken < 20000.0; calib_iterations *= 2)
     {
       apr_pool_t *scratch = svn_pool_create(pool);
       SVN_ERR(init_concurrency_test_shm(scratch, count));
@@ -404,16 +404,19 @@ calibrate_iterations(apr_pool_t *pool, i
       svn_pool_destroy(scratch);
     }
 
-  /* scale that to 1s */
+  /* scale that to .1s */
+  suggested_iterations = (int)(100000.0 / taken * calib_iterations);
 
-  suggested_iterations = (int)(1000000.0 / taken * calib_iterations);
+  /* 250k iterations should be plenty in any case. */
+  if (suggested_iterations > 250000)
+    suggested_iterations = 250000;
 
   return SVN_NO_ERROR;
 }
 
 /* Find out how far the system will scale, i.e. how many workers can be
  * run concurrently without experiencing significant slowdowns.
- * Sets HW_THREAD_COUNT to a value of 2 .. 32 (limit the system impact in
+ * Sets HW_THREAD_COUNT to a value of 2 .. 8 (limit the system impact in
  * case our heuristics fail) and determines the number of iterations.
  * Can be called multiple times but will skip the calculations after the
  * first successful run.
@@ -432,7 +435,7 @@ calibrate_concurrency(apr_pool_t *pool)
       if (svn_named_atomic__is_efficient() && proc_found(TEST_PROC, pool))
         {
           SVN_ERR(calibrate_iterations(pool, 2));
-          for (; hw_thread_count < 32; hw_thread_count *= 2)
+          for (; hw_thread_count < 8; hw_thread_count *= 2)
             {
               int saved_suggestion = suggested_iterations;
 
@@ -742,6 +745,9 @@ test_multiprocess(apr_pool_t *pool)
 */
 
 /* An array of all test functions */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/opt-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/opt-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/opt-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/opt-test.c Wed Nov 27 11:52:35 2013
@@ -193,6 +193,8 @@ test_svn_opt_args_to_target_array2(apr_p
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/path-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/path-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/path-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/path-test.c Wed Nov 27 11:52:35 2013
@@ -489,7 +489,7 @@ test_path_join(apr_pool_t *pool)
       if (svn_path_is_url(base))
         continue;
 
-      result = svn_path_join_many(pool, base, comp, NULL);
+      result = svn_path_join_many(pool, base, comp, SVN_VA_NULL);
       if (strcmp(result, expect))
         return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
                                  "svn_path_join_many(\"%s\", \"%s\") returned "
@@ -505,74 +505,74 @@ test_path_join(apr_pool_t *pool)
                              "expected \"%s\"", \
                              result, expect);
 
-  TEST_MANY((pool, "abc", NULL), "abc");
-  TEST_MANY((pool, "/abc", NULL), "/abc");
-  TEST_MANY((pool, "/", NULL), "/");
-
-  TEST_MANY((pool, "abc", "def", "ghi", NULL), "abc/def/ghi");
-  TEST_MANY((pool, "abc", "/def", "ghi", NULL), "/def/ghi");
-  TEST_MANY((pool, "/abc", "def", "ghi", NULL), "/abc/def/ghi");
-  TEST_MANY((pool, "abc", "def", "/ghi", NULL), "/ghi");
-  TEST_MANY((pool, "/", "def", "/ghi", NULL), "/ghi");
-  TEST_MANY((pool, "/", "/def", "/ghi", NULL), "/ghi");
-
-  TEST_MANY((pool, SVN_EMPTY_PATH, "def", "ghi", NULL), "def/ghi");
-  TEST_MANY((pool, "abc", SVN_EMPTY_PATH, "ghi", NULL), "abc/ghi");
-  TEST_MANY((pool, "abc", "def", SVN_EMPTY_PATH, NULL), "abc/def");
-  TEST_MANY((pool, SVN_EMPTY_PATH, "def", SVN_EMPTY_PATH, NULL), "def");
-  TEST_MANY((pool, SVN_EMPTY_PATH, SVN_EMPTY_PATH, "ghi", NULL), "ghi");
-  TEST_MANY((pool, "abc", SVN_EMPTY_PATH, SVN_EMPTY_PATH, NULL), "abc");
-  TEST_MANY((pool, SVN_EMPTY_PATH, "def", "/ghi", NULL), "/ghi");
-  TEST_MANY((pool, SVN_EMPTY_PATH, SVN_EMPTY_PATH, "/ghi", NULL), "/ghi");
-
-  TEST_MANY((pool, "/", "def", "ghi", NULL), "/def/ghi");
-  TEST_MANY((pool, "abc", "/", "ghi", NULL), "/ghi");
-  TEST_MANY((pool, "abc", "def", "/", NULL), "/");
-  TEST_MANY((pool, "/", "/", "ghi", NULL), "/ghi");
-  TEST_MANY((pool, "/", "/", "/", NULL), "/");
-  TEST_MANY((pool, "/", SVN_EMPTY_PATH, "ghi", NULL), "/ghi");
-  TEST_MANY((pool, "/", "def", SVN_EMPTY_PATH, NULL), "/def");
-  TEST_MANY((pool, SVN_EMPTY_PATH, "/", "ghi", NULL), "/ghi");
-  TEST_MANY((pool, "/", SVN_EMPTY_PATH, SVN_EMPTY_PATH, NULL), "/");
-  TEST_MANY((pool, SVN_EMPTY_PATH, "/", SVN_EMPTY_PATH, NULL), "/");
-  TEST_MANY((pool, SVN_EMPTY_PATH, SVN_EMPTY_PATH, "/", NULL), "/");
+  TEST_MANY((pool, "abc", SVN_VA_NULL), "abc");
+  TEST_MANY((pool, "/abc", SVN_VA_NULL), "/abc");
+  TEST_MANY((pool, "/", SVN_VA_NULL), "/");
+
+  TEST_MANY((pool, "abc", "def", "ghi", SVN_VA_NULL), "abc/def/ghi");
+  TEST_MANY((pool, "abc", "/def", "ghi", SVN_VA_NULL), "/def/ghi");
+  TEST_MANY((pool, "/abc", "def", "ghi", SVN_VA_NULL), "/abc/def/ghi");
+  TEST_MANY((pool, "abc", "def", "/ghi", SVN_VA_NULL), "/ghi");
+  TEST_MANY((pool, "/", "def", "/ghi", SVN_VA_NULL), "/ghi");
+  TEST_MANY((pool, "/", "/def", "/ghi", SVN_VA_NULL), "/ghi");
+
+  TEST_MANY((pool, SVN_EMPTY_PATH, "def", "ghi", SVN_VA_NULL), "def/ghi");
+  TEST_MANY((pool, "abc", SVN_EMPTY_PATH, "ghi", SVN_VA_NULL), "abc/ghi");
+  TEST_MANY((pool, "abc", "def", SVN_EMPTY_PATH, SVN_VA_NULL), "abc/def");
+  TEST_MANY((pool, SVN_EMPTY_PATH, "def", SVN_EMPTY_PATH, SVN_VA_NULL), "def");
+  TEST_MANY((pool, SVN_EMPTY_PATH, SVN_EMPTY_PATH, "ghi", SVN_VA_NULL), "ghi");
+  TEST_MANY((pool, "abc", SVN_EMPTY_PATH, SVN_EMPTY_PATH, SVN_VA_NULL), "abc");
+  TEST_MANY((pool, SVN_EMPTY_PATH, "def", "/ghi", SVN_VA_NULL), "/ghi");
+  TEST_MANY((pool, SVN_EMPTY_PATH, SVN_EMPTY_PATH, "/ghi", SVN_VA_NULL), "/ghi");
+
+  TEST_MANY((pool, "/", "def", "ghi", SVN_VA_NULL), "/def/ghi");
+  TEST_MANY((pool, "abc", "/", "ghi", SVN_VA_NULL), "/ghi");
+  TEST_MANY((pool, "abc", "def", "/", SVN_VA_NULL), "/");
+  TEST_MANY((pool, "/", "/", "ghi", SVN_VA_NULL), "/ghi");
+  TEST_MANY((pool, "/", "/", "/", SVN_VA_NULL), "/");
+  TEST_MANY((pool, "/", SVN_EMPTY_PATH, "ghi", SVN_VA_NULL), "/ghi");
+  TEST_MANY((pool, "/", "def", SVN_EMPTY_PATH, SVN_VA_NULL), "/def");
+  TEST_MANY((pool, SVN_EMPTY_PATH, "/", "ghi", SVN_VA_NULL), "/ghi");
+  TEST_MANY((pool, "/", SVN_EMPTY_PATH, SVN_EMPTY_PATH, SVN_VA_NULL), "/");
+  TEST_MANY((pool, SVN_EMPTY_PATH, "/", SVN_EMPTY_PATH, SVN_VA_NULL), "/");
+  TEST_MANY((pool, SVN_EMPTY_PATH, SVN_EMPTY_PATH, "/", SVN_VA_NULL), "/");
 
 #ifdef SVN_USE_DOS_PATHS
 /* These will fail, see issue #2028
-  TEST_MANY((pool, "X:", "def", "ghi", NULL), "X:def/ghi");
-  TEST_MANY((pool, "X:", SVN_EMPTY_PATH, "ghi", NULL), "X:ghi");
-  TEST_MANY((pool, "X:", "def", SVN_EMPTY_PATH, NULL), "X:def");
-  TEST_MANY((pool, SVN_EMPTY_PATH, "X:", "ghi", NULL), "X:ghi");
-  TEST_MANY((pool, "X:/", "def", "ghi", NULL), "X:/def/ghi");
-  TEST_MANY((pool, "abc", "X:/", "ghi", NULL), "X:/ghi");
-  TEST_MANY((pool, "abc", "def", "X:/", NULL), "X:/");
-  TEST_MANY((pool, "X:/", "X:/", "ghi", NULL), "X:/ghi");
-  TEST_MANY((pool, "X:/", "X:/", "/", NULL), "/");
-  TEST_MANY((pool, "X:/", SVN_EMPTY_PATH, "ghi", NULL), "X:/ghi");
-  TEST_MANY((pool, "X:/", "def", SVN_EMPTY_PATH, NULL), "X:/def");
-  TEST_MANY((pool, SVN_EMPTY_PATH, "X:/", "ghi", NULL), "X:/ghi");
-  TEST_MANY((pool, "X:/", SVN_EMPTY_PATH, SVN_EMPTY_PATH, NULL), "X:/");
-  TEST_MANY((pool, SVN_EMPTY_PATH, "X:/", SVN_EMPTY_PATH, NULL), "X:/");
-  TEST_MANY((pool, SVN_EMPTY_PATH, SVN_EMPTY_PATH, "X:/", NULL), "X:/");
-  TEST_MANY((pool, "X:", "X:/", "ghi", NULL), "X:/ghi");
-  TEST_MANY((pool, "X:", "X:/", "/", NULL), "/");
-
-  TEST_MANY((pool, "//srv/shr", "def", "ghi", NULL), "//srv/shr/def/ghi");
-  TEST_MANY((pool, "//srv", "shr", "def", "ghi", NULL), "//srv/shr/def/ghi");
-  TEST_MANY((pool, "//srv/shr/fld", "def", "ghi", NULL),
+  TEST_MANY((pool, "X:", "def", "ghi", SVN_VA_NULL), "X:def/ghi");
+  TEST_MANY((pool, "X:", SVN_EMPTY_PATH, "ghi", SVN_VA_NULL), "X:ghi");
+  TEST_MANY((pool, "X:", "def", SVN_EMPTY_PATH, SVN_VA_NULL), "X:def");
+  TEST_MANY((pool, SVN_EMPTY_PATH, "X:", "ghi", SVN_VA_NULL), "X:ghi");
+  TEST_MANY((pool, "X:/", "def", "ghi", SVN_VA_NULL), "X:/def/ghi");
+  TEST_MANY((pool, "abc", "X:/", "ghi", SVN_VA_NULL), "X:/ghi");
+  TEST_MANY((pool, "abc", "def", "X:/", SVN_VA_NULL), "X:/");
+  TEST_MANY((pool, "X:/", "X:/", "ghi", SVN_VA_NULL), "X:/ghi");
+  TEST_MANY((pool, "X:/", "X:/", "/", SVN_VA_NULL), "/");
+  TEST_MANY((pool, "X:/", SVN_EMPTY_PATH, "ghi", SVN_VA_NULL), "X:/ghi");
+  TEST_MANY((pool, "X:/", "def", SVN_EMPTY_PATH, SVN_VA_NULL), "X:/def");
+  TEST_MANY((pool, SVN_EMPTY_PATH, "X:/", "ghi", SVN_VA_NULL), "X:/ghi");
+  TEST_MANY((pool, "X:/", SVN_EMPTY_PATH, SVN_EMPTY_PATH, SVN_VA_NULL), "X:/");
+  TEST_MANY((pool, SVN_EMPTY_PATH, "X:/", SVN_EMPTY_PATH, SVN_VA_NULL), "X:/");
+  TEST_MANY((pool, SVN_EMPTY_PATH, SVN_EMPTY_PATH, "X:/", SVN_VA_NULL), "X:/");
+  TEST_MANY((pool, "X:", "X:/", "ghi", SVN_VA_NULL), "X:/ghi");
+  TEST_MANY((pool, "X:", "X:/", "/", SVN_VA_NULL), "/");
+
+  TEST_MANY((pool, "//srv/shr", "def", "ghi", SVN_VA_NULL), "//srv/shr/def/ghi");
+  TEST_MANY((pool, "//srv", "shr", "def", "ghi", SVN_VA_NULL), "//srv/shr/def/ghi");
+  TEST_MANY((pool, "//srv/shr/fld", "def", "ghi", SVN_VA_NULL),
             "//srv/shr/fld/def/ghi");
-  TEST_MANY((pool, "//srv/shr/fld", "def", "//srv/shr", NULL), "//srv/shr");
-  TEST_MANY((pool, "//srv", "shr", "//srv/shr", NULL), "//srv/shr");
-  TEST_MANY((pool, SVN_EMPTY_PATH, "//srv/shr/fld", "def", "ghi", NULL),
+  TEST_MANY((pool, "//srv/shr/fld", "def", "//srv/shr", SVN_VA_NULL), "//srv/shr");
+  TEST_MANY((pool, "//srv", "shr", "//srv/shr", SVN_VA_NULL), "//srv/shr");
+  TEST_MANY((pool, SVN_EMPTY_PATH, "//srv/shr/fld", "def", "ghi", SVN_VA_NULL),
             "//srv/shr/fld/def/ghi");
-  TEST_MANY((pool, SVN_EMPTY_PATH, "//srv/shr/fld", "def", "//srv/shr", NULL),
+  TEST_MANY((pool, SVN_EMPTY_PATH, "//srv/shr/fld", "def", "//srv/shr", SVN_VA_NULL),
             "//srv/shr");
 */
 #else /* WIN32 or Cygwin */
-  TEST_MANY((pool, "X:", "def", "ghi", NULL), "X:/def/ghi");
-  TEST_MANY((pool, "X:", SVN_EMPTY_PATH, "ghi", NULL), "X:/ghi");
-  TEST_MANY((pool, "X:", "def", SVN_EMPTY_PATH, NULL), "X:/def");
-  TEST_MANY((pool, SVN_EMPTY_PATH, "X:", "ghi", NULL), "X:/ghi");
+  TEST_MANY((pool, "X:", "def", "ghi", SVN_VA_NULL), "X:/def/ghi");
+  TEST_MANY((pool, "X:", SVN_EMPTY_PATH, "ghi", SVN_VA_NULL), "X:/ghi");
+  TEST_MANY((pool, "X:", "def", SVN_EMPTY_PATH, SVN_VA_NULL), "X:/def");
+  TEST_MANY((pool, SVN_EMPTY_PATH, "X:", "ghi", SVN_VA_NULL), "X:/ghi");
 #endif /* non-WIN32 */
 
   /* ### probably need quite a few more tests... */
@@ -1527,7 +1527,7 @@ condense_targets_tests_helper(const char
 
   /* Verify the common part with the expected (prefix with cwd). */
   if (*exp_common == '%')
-    exp_common_abs = apr_pstrcat(pool, curdir, exp_common + 1, (char *)NULL);
+    exp_common_abs = apr_pstrcat(pool, curdir, exp_common + 1, SVN_VA_NULL);
 
   if (strcmp(common_path, exp_common_abs) != 0)
     {
@@ -1544,7 +1544,7 @@ condense_targets_tests_helper(const char
     {
       const char * target = APR_ARRAY_IDX(condensed_targets, i, const char*);
       if (token && (*token == '%'))
-        token = apr_pstrcat(pool, curdir, token + 1, (char *)NULL);
+        token = apr_pstrcat(pool, curdir, token + 1, SVN_VA_NULL);
       if (! token ||
           (target && (strcmp(target, token) != 0)))
         {
@@ -1700,6 +1700,8 @@ test_path_resolve_repos_relative_url(apr
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/revision-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/revision-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/revision-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/revision-test.c Wed Nov 27 11:52:35 2013
@@ -123,6 +123,8 @@ test_revnum_parse(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/skel-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/skel-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/skel-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/skel-test.c Wed Nov 27 11:52:35 2013
@@ -886,6 +886,8 @@ unparse_list(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/spillbuf-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/spillbuf-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/spillbuf-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/spillbuf-test.c Wed Nov 27 11:52:35 2013
@@ -57,10 +57,8 @@ check_read(svn_spillbuf_t *buf,
 
 
 static svn_error_t *
-test_spillbuf_basic(apr_pool_t *pool)
+test_spillbuf__basic(apr_pool_t *pool, apr_size_t len, svn_spillbuf_t *buf)
 {
-  apr_size_t len = strlen(basic_data);  /* Don't include basic_data's NUL  */
-  svn_spillbuf_t *buf = svn_spillbuf__create(len, 10 * len, pool);
   int i;
   const char *readptr;
   apr_size_t readlen;
@@ -87,6 +85,22 @@ test_spillbuf_basic(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_spillbuf_basic(apr_pool_t *pool)
+{
+  apr_size_t len = strlen(basic_data);  /* Don't include basic_data's NUL  */
+  svn_spillbuf_t *buf = svn_spillbuf__create(len, 10 * len, pool);
+  return test_spillbuf__basic(pool, len, buf);
+}
+
+static svn_error_t *
+test_spillbuf_basic_spill_all(apr_pool_t *pool)
+{
+  apr_size_t len = strlen(basic_data);  /* Don't include basic_data's NUL  */
+  svn_spillbuf_t *buf =
+    svn_spillbuf__create_extended(len, 10 * len, TRUE, TRUE, NULL, pool);
+  return test_spillbuf__basic(pool, len, buf);
+}
 
 static svn_error_t *
 read_callback(svn_boolean_t *stop,
@@ -107,12 +121,8 @@ read_callback(svn_boolean_t *stop,
 
 
 static svn_error_t *
-test_spillbuf_callback(apr_pool_t *pool)
+test_spillbuf__callback(apr_pool_t *pool, svn_spillbuf_t *buf)
 {
-  svn_spillbuf_t *buf = svn_spillbuf__create(
-                          sizeof(basic_data) /* blocksize */,
-                          10 * sizeof(basic_data) /* maxsize */,
-                          pool);
   int i;
   int counter;
   svn_boolean_t exhausted;
@@ -133,15 +143,31 @@ test_spillbuf_callback(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
-
 static svn_error_t *
-test_spillbuf_file(apr_pool_t *pool)
+test_spillbuf_callback(apr_pool_t *pool)
 {
-  apr_size_t altsize = sizeof(basic_data) + 2;
   svn_spillbuf_t *buf = svn_spillbuf__create(
-                          altsize /* blocksize */,
-                          2 * sizeof(basic_data) /* maxsize */,
+                          sizeof(basic_data) /* blocksize */,
+                          10 * sizeof(basic_data) /* maxsize */,
                           pool);
+  return test_spillbuf__callback(pool, buf);
+}
+
+static svn_error_t *
+test_spillbuf_callback_spill_all(apr_pool_t *pool)
+{
+  svn_spillbuf_t *buf = svn_spillbuf__create_extended(
+                          sizeof(basic_data) /* blocksize */,
+                          10 * sizeof(basic_data) /* maxsize */,
+                          TRUE /* delte on close */,
+                          TRUE /* spill all data */,
+                          NULL, pool);
+  return test_spillbuf__callback(pool, buf);
+}
+
+static svn_error_t *
+test_spillbuf__file(apr_pool_t *pool, apr_size_t altsize, svn_spillbuf_t *buf)
+{
   int i;
   const char *readptr;
   apr_size_t readlen;
@@ -203,14 +229,33 @@ test_spillbuf_file(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_spillbuf_file(apr_pool_t *pool)
+{
+  apr_size_t altsize = sizeof(basic_data) + 2;
+  svn_spillbuf_t *buf = svn_spillbuf__create(
+                          altsize /* blocksize */,
+                          2 * sizeof(basic_data) /* maxsize */,
+                          pool);
+  return test_spillbuf__file(pool, altsize, buf);
+}
 
 static svn_error_t *
-test_spillbuf_interleaving(apr_pool_t *pool)
+test_spillbuf_file_spill_all(apr_pool_t *pool)
 {
-  svn_spillbuf_t *buf = svn_spillbuf__create(8 /* blocksize */,
-                                             15 /* maxsize */,
-                                             pool);
+  apr_size_t altsize = sizeof(basic_data) + 2;
+  svn_spillbuf_t *buf = svn_spillbuf__create_extended(
+                          altsize /* blocksize */,
+                          2 * sizeof(basic_data)  /* maxsize */,
+                          TRUE /* delte on close */,
+                          TRUE /* spill all data */,
+                          NULL, pool);
+  return test_spillbuf__file(pool, altsize, buf);
+}
 
+static svn_error_t *
+test_spillbuf__interleaving(apr_pool_t *pool, svn_spillbuf_t* buf)
+{
   SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
   SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
   /* now: two blocks: 8 and 4 bytes  */
@@ -238,18 +283,36 @@ test_spillbuf_interleaving(apr_pool_t *p
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_spillbuf_interleaving(apr_pool_t *pool)
+{
+  svn_spillbuf_t *buf = svn_spillbuf__create(8 /* blocksize */,
+                                             15 /* maxsize */,
+                                             pool);
+  return test_spillbuf__interleaving(pool, buf);
+}
+
+static svn_error_t *
+test_spillbuf_interleaving_spill_all(apr_pool_t *pool)
+{
+  svn_spillbuf_t *buf = svn_spillbuf__create_extended(
+                          8 /* blocksize */,
+                          15 /* maxsize */,
+                          TRUE /* delte on close */,
+                          TRUE /* spill all data */,
+                          NULL, pool);
+  return test_spillbuf__interleaving(pool, buf);
+}
 
 static svn_error_t *
 test_spillbuf_reader(apr_pool_t *pool)
 {
-  svn_spillbuf_reader_t *sbr;
+  svn_spillbuf_reader_t *sbr = svn_spillbuf__reader_create(4 /* blocksize */,
+                                                           100 /* maxsize */,
+                                                           pool);
   apr_size_t amt;
   char buf[10];
 
-  sbr = svn_spillbuf__reader_create(4 /* blocksize */,
-                                    100 /* maxsize */,
-                                    pool);
-
   SVN_ERR(svn_spillbuf__reader_write(sbr, "abcdef", 6, pool));
 
   /* Get a buffer from the underlying reader, and grab a couple bytes.  */
@@ -270,13 +333,13 @@ test_spillbuf_reader(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
-
 static svn_error_t *
 test_spillbuf_stream(apr_pool_t *pool)
 {
-  svn_stream_t *stream = svn_stream__from_spillbuf(8 /* blocksize */,
-                                                   15 /* maxsize */,
-                                                   pool);
+  svn_spillbuf_t *buf = svn_spillbuf__create(4 /* blocksize */,
+                                             100 /* maxsize */,
+                                             pool);
+  svn_stream_t *stream = svn_stream__from_spillbuf(buf, pool);
   char readbuf[256];
   apr_size_t readlen;
   apr_size_t writelen;
@@ -319,14 +382,9 @@ test_spillbuf_stream(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
-
 static svn_error_t *
-test_spillbuf_rwfile(apr_pool_t *pool)
+test_spillbuf__rwfile(apr_pool_t *pool, svn_spillbuf_t *buf)
 {
-  svn_spillbuf_t *buf = svn_spillbuf__create(4 /* blocksize */,
-                                             10 /* maxsize */,
-                                             pool);
-
   SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
   SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
   SVN_ERR(svn_spillbuf__write(buf, "mnopqr", 6, pool));
@@ -360,14 +418,30 @@ test_spillbuf_rwfile(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
-
 static svn_error_t *
-test_spillbuf_eof(apr_pool_t *pool)
+test_spillbuf_rwfile(apr_pool_t *pool)
 {
   svn_spillbuf_t *buf = svn_spillbuf__create(4 /* blocksize */,
                                              10 /* maxsize */,
                                              pool);
+  return test_spillbuf__rwfile(pool, buf);
+}
+
+static svn_error_t *
+test_spillbuf_rwfile_spill_all(apr_pool_t *pool)
+{
+  svn_spillbuf_t *buf = svn_spillbuf__create_extended(
+                          4 /* blocksize */,
+                          10 /* maxsize */,
+                          TRUE /* delte on close */,
+                          TRUE /* spill all data */,
+                          NULL, pool);
+  return test_spillbuf__rwfile(pool, buf);
+}
 
+static svn_error_t *
+test_spillbuf__eof(apr_pool_t *pool, svn_spillbuf_t *buf)
+{
   SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
   SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
   /* now: two blocks: 4 and 2 bytes, and 6 bytes in spill file.  */
@@ -415,19 +489,106 @@ test_spillbuf_eof(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_spillbuf_eof(apr_pool_t *pool)
+{
+  svn_spillbuf_t *buf = svn_spillbuf__create(4 /* blocksize */,
+                                             10 /* maxsize */,
+                                             pool);
+  return test_spillbuf__eof(pool, buf);
+}
+
+static svn_error_t *
+test_spillbuf_eof_spill_all(apr_pool_t *pool)
+{
+  svn_spillbuf_t *buf = svn_spillbuf__create_extended(
+                          4 /* blocksize */,
+                          10 /* maxsize */,
+                          TRUE /* delte on close */,
+                          TRUE /* spill all data */,
+                          NULL, pool);
+  return test_spillbuf__eof(pool, buf);
+}
+
+static svn_error_t *
+test_spillbuf__file_attrs(apr_pool_t *pool, svn_boolean_t spill_all,
+                          svn_spillbuf_t *buf)
+{
+  apr_finfo_t finfo;
+
+  SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
+  SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
+  SVN_ERR(svn_spillbuf__write(buf, "mnopqr", 6, pool));
+
+  /* Check that the spillbuf size is what we expect it to be */
+  SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) == 18);
+
+  /* Check file existence */
+  SVN_TEST_ASSERT(svn_spillbuf__get_filename(buf) != NULL);
+  SVN_TEST_ASSERT(svn_spillbuf__get_file(buf) != NULL);
+
+  /* The size of the file must match expectations */
+  SVN_ERR(svn_io_file_info_get(&finfo, APR_FINFO_SIZE,
+                               svn_spillbuf__get_file(buf), pool));
+  if (spill_all)
+    SVN_TEST_ASSERT(finfo.size == svn_spillbuf__get_size(buf));
+  else
+    SVN_TEST_ASSERT(finfo.size == (svn_spillbuf__get_size(buf)
+                                   - svn_spillbuf__get_memory_size(buf)));
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+test_spillbuf_file_attrs(apr_pool_t *pool)
+{
+  svn_spillbuf_t *buf = svn_spillbuf__create(4 /* blocksize */,
+                                             10 /* maxsize */,
+                                             pool);
+  return test_spillbuf__file_attrs(pool, FALSE, buf);
+}
+
+static svn_error_t *
+test_spillbuf_file_attrs_spill_all(apr_pool_t *pool)
+{
+  svn_spillbuf_t *buf = svn_spillbuf__create_extended(
+                          4 /* blocksize */,
+                          10 /* maxsize */,
+                          TRUE /* delte on close */,
+                          TRUE /* spill all data */,
+                          NULL, pool);
+  return test_spillbuf__file_attrs(pool, TRUE, buf);
+}
 
 /* The test table.  */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,
     SVN_TEST_PASS2(test_spillbuf_basic, "basic spill buffer test"),
+    SVN_TEST_PASS2(test_spillbuf_basic_spill_all,
+                   "basic spill buffer test (spill-all-data)"),
     SVN_TEST_PASS2(test_spillbuf_callback, "spill buffer read callback"),
+    SVN_TEST_PASS2(test_spillbuf_callback_spill_all,
+                   "spill buffer read callback (spill-all-data)"),
     SVN_TEST_PASS2(test_spillbuf_file, "spill buffer file test"),
+    SVN_TEST_PASS2(test_spillbuf_file_spill_all,
+                   "spill buffer file test (spill-all-data)"),
     SVN_TEST_PASS2(test_spillbuf_interleaving,
                    "interleaving reads and writes"),
+    SVN_TEST_PASS2(test_spillbuf_interleaving_spill_all,
+                   "interleaving reads and writes (spill-all-data)"),
     SVN_TEST_PASS2(test_spillbuf_reader, "spill buffer reader test"),
     SVN_TEST_PASS2(test_spillbuf_stream, "spill buffer stream test"),
     SVN_TEST_PASS2(test_spillbuf_rwfile, "read/write spill file"),
+    SVN_TEST_PASS2(test_spillbuf_rwfile_spill_all,
+                   "read/write spill file (spill-all-data)"),
     SVN_TEST_PASS2(test_spillbuf_eof, "validate reaching EOF of spill file"),
+    SVN_TEST_PASS2(test_spillbuf_eof_spill_all,
+                   "validate reaching EOF (spill-all-data)"),
+    SVN_TEST_PASS2(test_spillbuf_file_attrs, "check spill file properties"),
+    SVN_TEST_PASS2(test_spillbuf_file_attrs_spill_all,
+                   "check spill file properties (spill-all-data)"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/stream-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/stream-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/stream-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/stream-test.c Wed Nov 27 11:52:35 2013
@@ -727,8 +727,54 @@ test_stream_base64_2(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_stringbuf_from_stream(apr_pool_t *pool)
+{
+  const char *test_cases[] =
+    {
+      "",
+      "x",
+      "this string is longer than the default 64 minimum block size used"
+      "by the function under test",
+      NULL
+    };
+
+  const char **test_case;
+  for (test_case = test_cases; *test_case; ++test_case)
+    {
+      svn_stringbuf_t *result1, *result2, *result3, *result4;
+      svn_stringbuf_t *original = svn_stringbuf_create(*test_case, pool);
+
+      svn_stream_t *stream1 = svn_stream_from_stringbuf(original, pool);
+      svn_stream_t *stream2 = svn_stream_from_stringbuf(original, pool);
+
+      SVN_ERR(svn_stringbuf_from_stream(&result1, stream1, 0, pool));
+      SVN_ERR(svn_stringbuf_from_stream(&result2, stream1, 0, pool));
+      SVN_ERR(svn_stringbuf_from_stream(&result3, stream2, original->len,
+                                        pool));
+      SVN_ERR(svn_stringbuf_from_stream(&result4, stream2, original->len,
+                                        pool));
+
+      /* C-string contents must match */
+      SVN_TEST_STRING_ASSERT(result1->data, original->data);
+      SVN_TEST_STRING_ASSERT(result2->data, "");
+      SVN_TEST_STRING_ASSERT(result3->data, original->data);
+      SVN_TEST_STRING_ASSERT(result4->data, "");
+
+      /* assumed length must match */
+      SVN_TEST_ASSERT(result1->len == original->len);
+      SVN_TEST_ASSERT(result2->len == 0);
+      SVN_TEST_ASSERT(result3->len == original->len);
+      SVN_TEST_ASSERT(result4->len == 0);
+    }
+
+  return SVN_NO_ERROR;
+}
+
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,
@@ -752,5 +798,7 @@ struct svn_test_descriptor_t test_funcs[
                    "test base64 encoding/decoding streams"),
     SVN_TEST_PASS2(test_stream_base64_2,
                    "base64 decoding allocation problem"),
+    SVN_TEST_PASS2(test_stringbuf_from_stream,
+                   "test svn_stringbuf_from_stream"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/string-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/string-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/string-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/string-test.c Wed Nov 27 11:52:35 2013
@@ -38,6 +38,7 @@
 
 #include "svn_io.h"
 #include "svn_error.h"
+#include "svn_sorts.h"    /* MIN / MAX */
 #include "svn_string.h"   /* This includes <apr_*.h> */
 #include "private/svn_string_private.h"
 
@@ -58,7 +59,6 @@ fail(apr_pool_t *pool, const char *fmt, 
 
 /* Some of our own global variables, for simplicity.  Yes,
    simplicity. */
-svn_stringbuf_t *a = NULL, *b = NULL, *c = NULL;
 const char *phrase_1 = "hello, ";
 const char *phrase_2 = "a longish phrase of sorts, longer than 16 anyway";
 
@@ -68,7 +68,7 @@ const char *phrase_2 = "a longish phrase
 static svn_error_t *
 test1(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create(phrase_1, pool);
+  svn_stringbuf_t *a = svn_stringbuf_create(phrase_1, pool);
 
   /* Test that length, data, and null-termination are correct. */
   if ((a->len == strlen(phrase_1)) && ((strcmp(a->data, phrase_1)) == 0))
@@ -81,7 +81,7 @@ test1(apr_pool_t *pool)
 static svn_error_t *
 test2(apr_pool_t *pool)
 {
-  b = svn_stringbuf_ncreate(phrase_2, 16, pool);
+  svn_stringbuf_t *b = svn_stringbuf_ncreate(phrase_2, 16, pool);
 
   /* Test that length, data, and null-termination are correct. */
   if ((b->len == 16) && ((strncmp(b->data, phrase_2, 16)) == 0))
@@ -97,8 +97,8 @@ test3(apr_pool_t *pool)
   char *tmp;
   size_t old_len;
 
-  a = svn_stringbuf_create(phrase_1, pool);
-  b = svn_stringbuf_ncreate(phrase_2, 16, pool);
+  svn_stringbuf_t *a = svn_stringbuf_create(phrase_1, pool);
+  svn_stringbuf_t *b = svn_stringbuf_ncreate(phrase_2, 16, pool);
 
   tmp = apr_palloc(pool, (a->len + b->len + 1));
   strcpy(tmp, a->data);
@@ -117,7 +117,7 @@ test3(apr_pool_t *pool)
 static svn_error_t *
 test4(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create(phrase_1, pool);
+  svn_stringbuf_t *a = svn_stringbuf_create(phrase_1, pool);
   svn_stringbuf_appendcstr(a, "new bytes to append");
 
   /* Test that length, data, and null-termination are correct. */
@@ -132,7 +132,7 @@ test4(apr_pool_t *pool)
 static svn_error_t *
 test5(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create(phrase_1, pool);
+  svn_stringbuf_t *a = svn_stringbuf_create(phrase_1, pool);
   svn_stringbuf_appendbytes(a, "new bytes to append", 9);
 
   /* Test that length, data, and null-termination are correct. */
@@ -147,9 +147,9 @@ test5(apr_pool_t *pool)
 static svn_error_t *
 test6(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create(phrase_1, pool);
-  b = svn_stringbuf_create(phrase_2, pool);
-  c = svn_stringbuf_dup(a, pool);
+  svn_stringbuf_t *a = svn_stringbuf_create(phrase_1, pool);
+  svn_stringbuf_t *b = svn_stringbuf_create(phrase_2, pool);
+  svn_stringbuf_t *c = svn_stringbuf_dup(a, pool);
 
   /* Test that length, data, and null-termination are correct. */
   if ((svn_stringbuf_compare(a, c)) && (! svn_stringbuf_compare(b, c)))
@@ -165,7 +165,7 @@ test7(apr_pool_t *pool)
   char *tmp;
   size_t tmp_len;
 
-  c = svn_stringbuf_create(phrase_2, pool);
+  svn_stringbuf_t *c = svn_stringbuf_create(phrase_2, pool);
 
   tmp_len = c->len;
   tmp = apr_palloc(pool, c->len + 1);
@@ -185,7 +185,7 @@ test7(apr_pool_t *pool)
 static svn_error_t *
 test8(apr_pool_t *pool)
 {
-  c = svn_stringbuf_create(phrase_2, pool);
+  svn_stringbuf_t *c = svn_stringbuf_create(phrase_2, pool);
 
   svn_stringbuf_setempty(c);
 
@@ -199,7 +199,7 @@ test8(apr_pool_t *pool)
 static svn_error_t *
 test9(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create(phrase_1, pool);
+  svn_stringbuf_t *a = svn_stringbuf_create(phrase_1, pool);
 
   svn_stringbuf_fillchar(a, '#');
 
@@ -379,7 +379,7 @@ test_find_char_backward(const char* data
 {
   apr_size_t i;
 
-  a = svn_stringbuf_create(data, pool);
+  svn_stringbuf_t *a = svn_stringbuf_create(data, pool);
   i = svn_stringbuf_find_char_backward(a, ch);
 
   if (i == pos)
@@ -391,7 +391,7 @@ test_find_char_backward(const char* data
 static svn_error_t *
 test13(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create("test, test", pool);
+  svn_stringbuf_t *a = svn_stringbuf_create("test, test", pool);
 
   return test_find_char_backward(a->data, a->len, ',', 4, pool);
 }
@@ -399,7 +399,7 @@ test13(apr_pool_t *pool)
 static svn_error_t *
 test14(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create(",test test", pool);
+  svn_stringbuf_t *a = svn_stringbuf_create(",test test", pool);
 
   return test_find_char_backward(a->data, a->len, ',', 0, pool);
 }
@@ -407,7 +407,7 @@ test14(apr_pool_t *pool)
 static svn_error_t *
 test15(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create("testing,", pool);
+  svn_stringbuf_t *a = svn_stringbuf_create("testing,", pool);
 
   return test_find_char_backward(a->data,
                                  a->len,
@@ -419,7 +419,7 @@ test15(apr_pool_t *pool)
 static svn_error_t *
 test16(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create_empty(pool);
+  svn_stringbuf_t *a = svn_stringbuf_create_empty(pool);
 
   return test_find_char_backward(a->data, a->len, ',', 0, pool);
 }
@@ -427,7 +427,7 @@ test16(apr_pool_t *pool)
 static svn_error_t *
 test17(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create("test test test", pool);
+  svn_stringbuf_t *a = svn_stringbuf_create("test test test", pool);
 
   return test_find_char_backward(a->data,
                                  a->len,
@@ -443,7 +443,7 @@ test_first_non_whitespace(const char *st
 {
   apr_size_t i;
 
-  a = svn_stringbuf_create(str, pool);
+  svn_stringbuf_t *a = svn_stringbuf_create(str, pool);
 
   i = svn_stringbuf_first_non_whitespace(a);
 
@@ -474,8 +474,8 @@ test20(apr_pool_t *pool)
 static svn_error_t *
 test21(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create("    \ttest\t\t  \t  ", pool);
-  b = svn_stringbuf_create("test", pool);
+  svn_stringbuf_t *a = svn_stringbuf_create("    \ttest\t\t  \t  ", pool);
+  svn_stringbuf_t *b = svn_stringbuf_create("test", pool);
 
   svn_stringbuf_strip_whitespace(a);
 
@@ -490,8 +490,8 @@ test_stringbuf_unequal(const char* str1,
                        const char* str2,
                        apr_pool_t *pool)
 {
-  a = svn_stringbuf_create(str1, pool);
-  b = svn_stringbuf_create(str2, pool);
+  svn_stringbuf_t *a = svn_stringbuf_create(str1, pool);
+  svn_stringbuf_t *b = svn_stringbuf_create(str2, pool);
 
   if (svn_stringbuf_compare(a, b))
     return fail(pool, "test failed");
@@ -537,7 +537,42 @@ test24(apr_pool_t *pool)
   SVN_TEST_ASSERT(length == 20);
   SVN_TEST_STRING_ASSERT(buffer, "18446744073709551615");
 
-  return test_stringbuf_unequal("abc", "abb", pool);
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+sub_test_base36(apr_uint64_t value, const char *base36)
+{
+  char buffer[SVN_INT64_BUFFER_SIZE];
+  apr_size_t length;
+  apr_size_t expected_length = strlen(base36);
+  const char *end = buffer;
+  apr_uint64_t result;
+
+  length = svn__ui64tobase36(buffer, value);
+  SVN_TEST_ASSERT(length == expected_length);
+  SVN_TEST_STRING_ASSERT(buffer, base36);
+
+  result = svn__base36toui64(&end, buffer);
+  SVN_TEST_ASSERT(end - buffer == length);
+  SVN_TEST_ASSERT(result == value);
+
+  result = svn__base36toui64(NULL, buffer);
+  SVN_TEST_ASSERT(result == value);
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+test_base36(apr_pool_t *pool)
+{
+  SVN_ERR(sub_test_base36(0, "0"));
+  SVN_ERR(sub_test_base36(1234567890ull, "kf12oi"));
+  SVN_ERR(sub_test_base36(0x7fffffffffffffffull, "1y2p0ij32e8e7"));
+  SVN_ERR(sub_test_base36(0x8000000000000000ull, "1y2p0ij32e8e8"));
+  SVN_ERR(sub_test_base36(0xffffffffffffffffull, "3w5e11264sgsf"));
+
+  return SVN_NO_ERROR;
 }
 
 static svn_error_t *
@@ -554,7 +589,7 @@ expect_stringbuf_equal(const svn_stringb
 static svn_error_t *
 test_stringbuf_insert(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create("st , ", pool);
+  svn_stringbuf_t *a = svn_stringbuf_create("st , ", pool);
 
   svn_stringbuf_insert(a, 0, "teflon", 2);
   SVN_TEST_STRING_ASSERT(a->data, "test , ");
@@ -575,7 +610,7 @@ test_stringbuf_insert(apr_pool_t *pool)
 static svn_error_t *
 test_stringbuf_remove(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create("test hello, world!", pool);
+  svn_stringbuf_t *a = svn_stringbuf_create("test hello, world!", pool);
 
   svn_stringbuf_remove(a, 0, 2);
   SVN_TEST_STRING_ASSERT(a->data, "st hello, world!");
@@ -593,7 +628,7 @@ test_stringbuf_remove(apr_pool_t *pool)
 static svn_error_t *
 test_stringbuf_replace(apr_pool_t *pool)
 {
-  a = svn_stringbuf_create("odd with some world?", pool);
+  svn_stringbuf_t *a = svn_stringbuf_create("odd with some world?", pool);
 
   svn_stringbuf_replace(a, 0, 3, "tester", 4);
   SVN_TEST_STRING_ASSERT(a->data, "test with some world?");
@@ -620,7 +655,7 @@ test_string_similarity(apr_pool_t *pool)
     const char *stra;
     const char *strb;
     apr_size_t lcs;
-    int score;
+    unsigned int score;
   } tests[] =
       {
 #define SCORE(lcs, len) ((2000 * (lcs) + (len)/2) / (len))
@@ -711,6 +746,85 @@ test_string_similarity(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_string_matching(apr_pool_t *pool)
+{
+  const struct test_data_t
+    {
+      const char *a;
+      const char *b;
+      apr_size_t match_len;
+      apr_size_t rmatch_len;
+    }
+  tests[] =
+    {
+      /* edge cases */
+      {"", "", 0, 0},
+      {"", "x", 0, 0},
+      {"x", "", 0, 0},
+      {"x", "x", 1, 1},
+      {"", "1234567890abcdef", 0, 0},
+      {"1234567890abcdef", "", 0, 0},
+      {"1234567890abcdef", "1234567890abcdef", 16, 16},
+
+      /* left-side matches */
+      {"x", "y", 0, 0},
+      {"ax", "ay", 1, 0},
+      {"ax", "a", 1, 0},
+      {"a", "ay", 1, 0},
+      {"1234567890abcdef", "1234567890abcdeg", 15, 0},
+      {"1234567890abcdef_", "1234567890abcdefg", 16, 0},
+      {"12345678_0abcdef", "1234567890abcdeg", 8, 0},
+      {"1234567890abcdef", "12345678", 8, 0},
+      {"12345678", "1234567890abcdef", 8, 0},
+      {"12345678_0ab", "1234567890abcdef", 8, 0},
+
+      /* right-side matches */
+      {"xa", "ya", 0, 1},
+      {"xa", "a", 0, 1},
+      {"a", "ya", 0, 1},
+      {"_234567890abcdef", "1234567890abcdef", 0, 15},
+      {"_1234567890abcdef", "x1234567890abcdef", 0, 16},
+      {"1234567_90abcdef", "_1234567890abcdef", 0, 8},
+      {"1234567890abcdef", "90abcdef", 0, 8},
+      {"90abcdef", "1234567890abcdef", 0, 8},
+      {"8_0abcdef", "7890abcdef", 0, 7},
+
+      /* two-side matches */
+      {"bxa", "bya", 1, 1},
+      {"bxa", "ba", 1, 1},
+      {"ba", "bya", 1, 1},
+      {"1234567_90abcdef", "1234567890abcdef", 7, 8},
+      {"12345678_90abcdef", "1234567890abcdef", 8, 8},
+      {"12345678_0abcdef", "1234567890abcdef", 8, 7},
+      {"123456_abcdef", "1234sdffdssdf567890abcdef", 4, 6},
+      {"1234567890abcdef", "12345678ef", 8, 2},
+      {"x_234567890abcdef", "x1234567890abcdef", 1, 15},
+      {"1234567890abcdefx", "1234567890abcdex", 15, 1},
+
+      /* list terminator */
+      {NULL}
+    };
+
+  const struct test_data_t *test;
+  for (test = tests; test->a != NULL; ++test)
+    {
+      apr_size_t a_len = strlen(test->a);
+      apr_size_t b_len = strlen(test->b);
+      apr_size_t max_match = MIN(a_len, b_len);
+      apr_size_t match_len
+        = svn_cstring__match_length(test->a, test->b, max_match);
+      apr_size_t rmatch_len
+        = svn_cstring__reverse_match_length(test->a + a_len, test->b + b_len,
+                                            max_match);
+
+      SVN_TEST_ASSERT(match_len == test->match_len);
+      SVN_TEST_ASSERT(rmatch_len == test->rmatch_len);
+    }
+  
+  return SVN_NO_ERROR;
+}
+
 /*
    ====================================================================
    If you add a new test to this file, update this array.
@@ -719,6 +833,9 @@ test_string_similarity(apr_pool_t *pool)
 */
 
 /* An array of all test functions */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,
@@ -770,6 +887,8 @@ struct svn_test_descriptor_t test_funcs[
                    "compare stringbufs; same length, different content"),
     SVN_TEST_PASS2(test24,
                    "verify i64toa"),
+    SVN_TEST_PASS2(test_base36,
+                   "verify base36 conversion"),
     SVN_TEST_PASS2(test_stringbuf_insert,
                    "check inserting into svn_stringbuf_t"),
     SVN_TEST_PASS2(test_stringbuf_remove,
@@ -778,5 +897,7 @@ struct svn_test_descriptor_t test_funcs[
                    "check replacement in svn_stringbuf_t"),
     SVN_TEST_PASS2(test_string_similarity,
                    "test string similarity scores"),
+    SVN_TEST_PASS2(test_string_matching,
+                   "test string matching"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/subst_translate-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/subst_translate-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/subst_translate-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/subst_translate-test.c Wed Nov 27 11:52:35 2013
@@ -27,6 +27,7 @@
 
 #include "../svn_test.h"
 
+#include "svn_private_config.h"
 #include "svn_types.h"
 #include "svn_string.h"
 #include "svn_subst.h"
@@ -500,6 +501,8 @@ test_svn_subst_long_keywords(apr_pool_t 
   return SVN_NO_ERROR;
 }
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/time-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/time-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/time-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/time-test.c Wed Nov 27 11:52:35 2013
@@ -339,6 +339,8 @@ test_parse_date(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/translate-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/translate-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/translate-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/translate-test.c Wed Nov 27 11:52:35 2013
@@ -325,8 +325,8 @@ substitute_and_verify(const char *test_n
   apr_size_t idx = 0;
   apr_size_t i;
   const char *expect[(sizeof(lines) / sizeof(*lines))];
-  const char *src_fname = apr_pstrcat(pool, test_name, ".src", (char *)NULL);
-  const char *dst_fname = apr_pstrcat(pool, test_name, ".dst", (char *)NULL);
+  const char *src_fname = apr_pstrcat(pool, test_name, ".src", SVN_VA_NULL);
+  const char *dst_fname = apr_pstrcat(pool, test_name, ".dst", SVN_VA_NULL);
   svn_string_t *val;
   apr_pool_t *subpool = svn_pool_create(pool);
 
@@ -419,27 +419,27 @@ substitute_and_verify(const char *test_n
                         "Valid $LastChangedRevision: ",
                         rev,
                         " $, started unexpanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[5 - 1] =
             apr_pstrcat(pool, "Line 5: ",
                         "Valid $Rev: ", rev, " $, started unexpanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[26 - 1] =
             apr_pstrcat(pool, "Line 26: ",
                         "Emptily expanded keyword $Rev: ", rev," $.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[29 - 1] =
             apr_pstrcat(pool, "Line 29: ",
                         "Valid $LastChangedRevision: ",
                         rev,
                         " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[30 - 1] =
             apr_pstrcat(pool, "Line 30: ",
                         "Valid $Rev: ",
                         rev,
                         " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
         }
       else  /* unexpand */
         {
@@ -462,31 +462,31 @@ substitute_and_verify(const char *test_n
                         "Valid $LastChangedDate: ",
                         date,
                         " $, started unexpanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[13 - 1] =
             apr_pstrcat(pool, "Line 13: ",
                         "Valid $Date: ", date, " $, started unexpanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[33 - 1] =
             apr_pstrcat(pool, "Line 33: ",
                         "Valid $LastChangedDate: ",
                         date,
                         " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[34 - 1] =
             apr_pstrcat(pool, "Line 34: ",
                         "Valid $Date: ", date, " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[51 - 1] =
             apr_pstrcat(pool, "Line 51: ",
                         "same, but with embedded keyword ",
                         "$$$$$$$$Date: ", date, " $$$$$$$$$$.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[52 - 1] =
             apr_pstrcat(pool, "Line 52: ",
                         "same, with expanded, empty keyword ",
                         "$$$$$$Date: ", date, " $$$$$$.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
         }
       else  /* unexpand */
         {
@@ -511,46 +511,46 @@ substitute_and_verify(const char *test_n
                         "Valid $LastChangedBy: ",
                         author,
                         " $, started unexpanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[9 - 1] =
             apr_pstrcat(pool, "Line 9: ",
                         "Valid $Author: ", author, " $, started unexpanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[37 - 1] =
             apr_pstrcat(pool, "Line 37: ",
                         "Valid $LastChangedBy: ", author,
-                        " $, started expanded.", (char *)NULL);
+                        " $, started expanded.", SVN_VA_NULL);
           expect[38 - 1] =
             apr_pstrcat(pool, "Line 38: ",
                         "Valid $Author: ", author, " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[46 - 1] =
             apr_pstrcat(pool, "Line 46: ",
                         "Empty $Author: ", author, " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[71 - 1] =
-            apr_pstrcat(pool, ".$veR$Author: ", author, " $", (char *)NULL);
+            apr_pstrcat(pool, ".$veR$Author: ", author, " $", SVN_VA_NULL);
 
           expect[74 - 1] =
             apr_pstrcat(pool, "Line 74: ",
                         "Valid $Author: ", author, " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[79 - 1] =
             apr_pstrcat(pool, "Line 79: ",
                         "Valid $Author: ", author, " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[80 - 1] =
             apr_pstrcat(pool, "Line 80: ",
                         "Valid $Author: ", author, " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[81 - 1] =
             apr_pstrcat(pool, "Line 81: ",
                         "Valid $Author: ", author, " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[82 - 1] =
             apr_pstrcat(pool, "Line 82: ",
                         "Valid $Author: ", author, " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
         }
       else  /* unexpand */
         {
@@ -581,23 +581,23 @@ substitute_and_verify(const char *test_n
           expect[16 - 1] =
             apr_pstrcat(pool, "Line 16: ",
                         "Valid $HeadURL: ", url, " $, started unexpanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[17 - 1] =
             apr_pstrcat(pool, "Line 17: ",
                         "Valid $URL: ", url, " $, started unexpanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[41 - 1] =
             apr_pstrcat(pool, "Line 41: ",
                         "Valid $HeadURL: ", url, " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[42 - 1] =
             apr_pstrcat(pool, "Line 42: ",
                         "Valid $URL: ", url, " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[75 - 1] =
             apr_pstrcat(pool, "Line 75: ",
                         "Valid $URL: ", url, " $, started expanded.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
         }
       else  /* unexpand */
         {
@@ -622,14 +622,14 @@ substitute_and_verify(const char *test_n
                         "Two keywords back to back: "
                         "$Author: ", author, " $"
                         "$Rev: ", rev, " $.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[49 - 1] =
             apr_pstrcat(pool, "Line 49: ",
                         "One keyword, one not, back to back: "
                         "$Author: ", author, " $Rev$.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[70 - 1] =
-            apr_pstrcat(pool, "$Author: ", author, " $Rev$.", (char *)NULL);
+            apr_pstrcat(pool, "$Author: ", author, " $Rev$.", SVN_VA_NULL);
         }
       /* Else Lines 48, 49, and 70 remain unchanged. */
     }
@@ -641,14 +641,14 @@ substitute_and_verify(const char *test_n
             apr_pstrcat(pool, "Line 48: ",
                         "Two keywords back to back: "
                         "$Author$$Rev: ", rev, " $.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[49 - 1] =
             apr_pstrcat(pool, "Line 49: ",
                         "One keyword, one not, back to back: "
                         "$Author$Rev: ", rev, " $.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[70 - 1] =
-            apr_pstrcat(pool, "$Author$Rev: ", rev, " $.", (char *)NULL);
+            apr_pstrcat(pool, "$Author$Rev: ", rev, " $.", SVN_VA_NULL);
         }
       /* Else Lines 48, 49, and 70 remain unchanged. */
     }
@@ -660,14 +660,14 @@ substitute_and_verify(const char *test_n
             apr_pstrcat(pool, "Line 48: ",
                         "Two keywords back to back: "
                         "$Author: ", author, " $$Rev$.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[49 - 1] =
             apr_pstrcat(pool, "Line 49: ",
                         "One keyword, one not, back to back: "
                         "$Author: ", author, " $Rev$.",
-                        (char *)NULL);
+                        SVN_VA_NULL);
           expect[70 - 1] =
-            apr_pstrcat(pool, "$Author: ", author, " $Rev$.", (char *)NULL);
+            apr_pstrcat(pool, "$Author: ", author, " $Rev$.", SVN_VA_NULL);
         }
       /* Else Lines 48, 49, and 70 remain unchanged. */
     }
@@ -684,14 +684,14 @@ substitute_and_verify(const char *test_n
                         "keyword in a keyword: $Author: ",
                         author,
                         " $Date$ $",
-                        (char *)NULL);
+                        SVN_VA_NULL);
         }
       else  /* unexpand */
         {
           expect[24 - 1] =
             apr_pstrcat(pool, "Line 24: ",
                         "keyword in a keyword: $Author$Date$ $",
-                        (char *)NULL);
+                        SVN_VA_NULL);
         }
     }
   else if (date && (! author))
@@ -703,7 +703,7 @@ substitute_and_verify(const char *test_n
                         "keyword in a keyword: $Author: $Date: ",
                         date,
                         " $ $",
-                        (char *)NULL);
+                        SVN_VA_NULL);
         }
       /* Else Line 24 remains unchanged. */
     }
@@ -716,14 +716,14 @@ substitute_and_verify(const char *test_n
                         "keyword in a keyword: $Author: ",
                         author,
                         " $Date$ $",
-                        (char *)NULL);
+                        SVN_VA_NULL);
         }
       else  /* unexpand */
         {
           expect[24 - 1] =
             apr_pstrcat(pool, "Line 24: ",
                         "keyword in a keyword: $Author$Date$ $",
-                        (char *)NULL);
+                        SVN_VA_NULL);
         }
     }
   /* Else neither author nor date, so Line 24 remains unchanged. */
@@ -862,7 +862,7 @@ static svn_error_t *
 mixed_to_lf(apr_pool_t *pool)
 {
   return substitute_and_verify
-          ("cr_to_lf", NULL, "\n", 1, NULL, NULL, NULL, NULL, 1, pool);
+          ("mixed_to_lf", NULL, "\n", 1, NULL, NULL, NULL, NULL, 1, pool);
 }
 
 
@@ -1096,10 +1096,10 @@ static svn_error_t *
 unexpand_author(apr_pool_t *pool)
 {
   SVN_ERR(substitute_and_verify
-          ("author", "\n", NULL, 0, NULL, NULL, "jrandom", NULL, 0, pool));
+          ("unexpand_author", "\n", NULL, 0, NULL, NULL, "jrandom", NULL, 0, pool));
 
   SVN_ERR(substitute_and_verify
-          ("author", "\r\n", NULL, 0, NULL, NULL, "jrandom", NULL, 0, pool));
+          ("unexpand_author", "\r\n", NULL, 0, NULL, NULL, "jrandom", NULL, 0, pool));
 
   return SVN_NO_ERROR;
 }
@@ -1109,11 +1109,11 @@ static svn_error_t *
 unexpand_date(apr_pool_t *pool)
 {
   SVN_ERR(substitute_and_verify
-          ("date", "\n", NULL, 0,
+          ("unexpand_date", "\n", NULL, 0,
            NULL, "Wed Jan  9 07:49:05 2002", NULL, NULL, 0, pool));
 
   SVN_ERR(substitute_and_verify
-          ("date", "\r\n", NULL, 0,
+          ("unexpand_date", "\r\n", NULL, 0,
            NULL, "Wed Jan  9 07:49:05 2002", NULL, NULL, 0, pool));
 
   return SVN_NO_ERROR;
@@ -1124,11 +1124,11 @@ static svn_error_t *
 unexpand_author_date(apr_pool_t *pool)
 {
   SVN_ERR(substitute_and_verify
-          ("author_date", "\n", NULL, 0,
+          ("unexpand_author_date", "\n", NULL, 0,
            NULL, "Wed Jan  9 07:49:05 2002", "jrandom", NULL, 0, pool));
 
   SVN_ERR(substitute_and_verify
-          ("author_date", "\r\n", NULL, 0,
+          ("unexpand_author_date", "\r\n", NULL, 0,
            NULL, "Wed Jan  9 07:49:05 2002", "jrandom", NULL, 0, pool));
 
   return SVN_NO_ERROR;
@@ -1139,11 +1139,11 @@ static svn_error_t *
 unexpand_author_rev(apr_pool_t *pool)
 {
   SVN_ERR(substitute_and_verify
-          ("author_rev", "\n", NULL, 0,
+          ("unexpand_author_rev", "\n", NULL, 0,
            "1729", NULL, "jrandom", NULL, 0, pool));
 
   SVN_ERR(substitute_and_verify
-          ("author_rev", "\r\n", NULL, 0,
+          ("unexpand_author_rev", "\r\n", NULL, 0,
            "1729", NULL, "jrandom", NULL, 0, pool));
 
   return SVN_NO_ERROR;
@@ -1154,11 +1154,11 @@ static svn_error_t *
 unexpand_rev(apr_pool_t *pool)
 {
   SVN_ERR(substitute_and_verify
-          ("rev", "\n", NULL, 0,
+          ("unexpand_rev", "\n", NULL, 0,
            "1729", NULL, NULL, NULL, 0, pool));
 
   SVN_ERR(substitute_and_verify
-          ("rev", "\r\n", NULL, 0,
+          ("unexpand_rev", "\r\n", NULL, 0,
            "1729", NULL, NULL, NULL, 0, pool));
 
   return SVN_NO_ERROR;
@@ -1169,11 +1169,11 @@ static svn_error_t *
 unexpand_rev_url(apr_pool_t *pool)
 {
   SVN_ERR(substitute_and_verify
-          ("rev_url", "\n", NULL, 0,
+          ("unexpand_rev_url", "\n", NULL, 0,
            "1729", NULL, NULL, "http://subversion.tigris.org", 0, pool));
 
   SVN_ERR(substitute_and_verify
-          ("rev_url", "\r\n", NULL, 0,
+          ("unexpand_rev_url", "\r\n", NULL, 0,
            "1729", NULL, NULL, "http://subversion.tigris.org", 0, pool));
 
   return SVN_NO_ERROR;
@@ -1184,7 +1184,7 @@ static svn_error_t *
 unexpand_author_date_rev_url(apr_pool_t *pool)
 {
   SVN_ERR(substitute_and_verify
-          ("author_date_rev_url", "\n", NULL, 0,
+          ("unexpand_author_date_rev_url", "\n", NULL, 0,
            "1729",
            "Wed Jan  9 07:49:05 2002",
            "jrandom",
@@ -1192,7 +1192,7 @@ unexpand_author_date_rev_url(apr_pool_t 
            1, pool));
 
   SVN_ERR(substitute_and_verify
-          ("author_date_rev_url", "\r\n", NULL, 0,
+          ("unexpand_author_date_rev_url", "\r\n", NULL, 0,
            "1729",
            "Wed Jan  9 07:49:05 2002",
            "jrandom",
@@ -1210,7 +1210,7 @@ static svn_error_t *
 lf_to_crlf_unexpand_author(apr_pool_t *pool)
 {
   return substitute_and_verify
-          ("lf_to_crlf_author", "\n", "\r\n", 0,
+          ("lf_to_crlf_unexpand_author", "\n", "\r\n", 0,
            NULL, NULL, "jrandom", NULL, 0, pool);
 }
 
@@ -1219,7 +1219,7 @@ static svn_error_t *
 mixed_to_lf_unexpand_author_date(apr_pool_t *pool)
 {
   return substitute_and_verify
-          ("mixed_to_lf_author_date", NULL, "\n", 1,
+          ("mixed_to_lf_unexpand_author_date", NULL, "\n", 1,
            NULL, "Wed Jan  9 07:49:05 2002", "jrandom", NULL, 0, pool);
 }
 
@@ -1228,7 +1228,7 @@ static svn_error_t *
 crlf_to_cr_unexpand_author_rev(apr_pool_t *pool)
 {
   return substitute_and_verify
-          ("crlf_to_cr_author_rev", "\r\n", "\r", 0,
+          ("crlf_to_cr_unexpand_author_rev", "\r\n", "\r", 0,
            "1729", NULL, "jrandom", NULL, 0, pool);
 }
 
@@ -1237,7 +1237,7 @@ static svn_error_t *
 cr_to_crlf_unexpand_rev(apr_pool_t *pool)
 {
   return substitute_and_verify
-          ("cr_to_crlf_rev", "\r", "\r\n", 0,
+          ("cr_to_crlf_unexpand_rev", "\r", "\r\n", 0,
            "1729", NULL, NULL, NULL, 0, pool);
 }
 
@@ -1246,7 +1246,7 @@ static svn_error_t *
 cr_to_crlf_unexpand_rev_url(apr_pool_t *pool)
 {
   return substitute_and_verify
-          ("cr_to_crlf_rev_url", "\r", "\r\n", 0,
+          ("cr_to_crlf_unexpand_rev_url", "\r", "\r\n", 0,
            "1729", NULL, NULL, "http://subversion.tigris.org", 0, pool);
 }
 
@@ -1255,7 +1255,7 @@ static svn_error_t *
 mixed_to_crlf_unexpand_author_date_rev_url(apr_pool_t *pool)
 {
   return substitute_and_verify
-          ("mixed_to_crlf_author_date_rev_url", NULL, "\r\n", 1,
+          ("mixed_to_crlf_unexpand_author_date_rev_url", NULL, "\r\n", 1,
            "1729",
            "Wed Jan  9 07:49:05 2002",
            "jrandom",
@@ -1268,6 +1268,8 @@ mixed_to_crlf_unexpand_author_date_rev_u
 
 /* The test table.  */
 
+int svn_test_max_threads = 7;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/utf-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/utf-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/utf-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_subr/utf-test.c Wed Nov 27 11:52:35 2013
@@ -618,9 +618,130 @@ test_utf_pattern_match(apr_pool_t *pool)
 }
 
 
+static svn_error_t *
+test_utf_fuzzy_escape(apr_pool_t *pool)
+{
+
+  /* Accented latin, mixed normalization */
+  static const char mixup[] =
+    "S\xcc\x87\xcc\xa3"         /* S with dot above and below */
+    "\xc5\xaf"                  /* u with ring */
+    "b\xcc\xb1"                 /* b with macron below */
+    "\xe1\xb9\xbd"              /* v with tilde */
+    "e\xcc\xa7\xcc\x86"         /* e with breve and cedilla */
+    "\xc8\x91"                  /* r with double grave */
+    "s\xcc\x8c"                 /* s with caron */
+    "\xe1\xb8\xaf"              /* i with diaeresis and acute */
+    "o\xcc\x80\xcc\x9b"         /* o with grave and hook */
+    "\xe1\xb9\x8b";             /* n with circumflex below */
+
+  /* As above, but latin lowercase 'o' replaced with Greek 'omicron' */
+  static const char greekish[] =
+    "S\xcc\x87\xcc\xa3"         /* S with dot above and below */
+    "\xc5\xaf"                  /* u with ring */
+    "b\xcc\xb1"                 /* b with macron below */
+    "\xe1\xb9\xbd"              /* v with tilde */
+    "e\xcc\xa7\xcc\x86"         /* e with breve and cedilla */
+    "\xc8\x91"                  /* r with double grave */
+    "s\xcc\x8c"                 /* s with caron */
+    "\xe1\xb8\xaf"              /* i with diaeresis and acute */
+    "\xce\xbf\xcc\x80\xcc\x9b"  /* omicron with grave and hook */
+    "\xe1\xb9\x8b";             /* n with circumflex below */
+
+  /* More interesting invalid characters. */
+  static const char invalid[] =
+    "Not Unicode: \xef\xb7\x91;"      /* U+FDD1 */
+    "Out of range: \xf4\x90\x80\x81;" /* U+110001 */
+    "Not UTF-8: \xe6;"
+    "Null byte: \0;";
+
+  const char *fuzzy;
+
+  fuzzy = svn_utf__fuzzy_escape(mixup, strlen(mixup), pool);
+  SVN_TEST_ASSERT(0 == strcmp(fuzzy, "Subversion"));
+
+  fuzzy = svn_utf__fuzzy_escape(greekish, strlen(greekish), pool);
+  SVN_TEST_ASSERT(0 == strcmp(fuzzy, "Subversi{U+03BF}n"));
+
+  fuzzy = svn_utf__fuzzy_escape(invalid, sizeof(invalid) - 1, pool);
+  /*fprintf(stderr, "%s\n", fuzzy);*/
+  SVN_TEST_ASSERT(0 == strcmp(fuzzy,
+                              "Not Unicode: {U?FDD1};"
+                              "Out of range: ?\\F4?\\90?\\80?\\81;"
+                              "Not UTF-8: ?\\E6;"
+                              "Null byte: \\0;"));
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+test_utf_is_normalized(apr_pool_t *pool)
+{
+  /* Normalized: NFC */
+  static const char nfc[] =
+    "\xe1\xb9\xa8"              /* S with dot above and below */
+    "\xc5\xaf"                  /* u with ring */
+    "\xe1\xb8\x87"              /* b with macron below */
+    "\xe1\xb9\xbd"              /* v with tilde */
+    "\xe1\xb8\x9d"              /* e with breve and cedilla */
+    "\xc8\x91"                  /* r with double grave */
+    "\xc5\xa1"                  /* s with caron */
+    "\xe1\xb8\xaf"              /* i with diaeresis and acute */
+    "\xe1\xbb\x9d"              /* o with grave and hook */
+    "\xe1\xb9\x8b";             /* n with circumflex below */
+
+  /* Normalized: NFD */
+  static const char nfd[] =
+    "S\xcc\xa3\xcc\x87"         /* S with dot above and below */
+    "u\xcc\x8a"                 /* u with ring */
+    "b\xcc\xb1"                 /* b with macron below */
+    "v\xcc\x83"                 /* v with tilde */
+    "e\xcc\xa7\xcc\x86"         /* e with breve and cedilla */
+    "r\xcc\x8f"                 /* r with double grave */
+    "s\xcc\x8c"                 /* s with caron */
+    "i\xcc\x88\xcc\x81"         /* i with diaeresis and acute */
+    "o\xcc\x9b\xcc\x80"         /* o with grave and hook */
+    "n\xcc\xad";                /* n with circumflex below */
+
+  /* Mixed, denormalized */
+  static const char mixup[] =
+    "S\xcc\x87\xcc\xa3"         /* S with dot above and below */
+    "\xc5\xaf"                  /* u with ring */
+    "b\xcc\xb1"                 /* b with macron below */
+    "\xe1\xb9\xbd"              /* v with tilde */
+    "e\xcc\xa7\xcc\x86"         /* e with breve and cedilla */
+    "\xc8\x91"                  /* r with double grave */
+    "s\xcc\x8c"                 /* s with caron */
+    "\xe1\xb8\xaf"              /* i with diaeresis and acute */
+    "o\xcc\x80\xcc\x9b"         /* o with grave and hook */
+    "\xe1\xb9\x8b";             /* n with circumflex below */
+
+  /* Invalid UTF-8 */
+  static const char invalid[] =
+    "\xe1\xb9\xa8"              /* S with dot above and below */
+    "\xc5\xaf"                  /* u with ring */
+    "\xe1\xb8\x87"              /* b with macron below */
+    "\xe1\xb9\xbd"              /* v with tilde */
+    "\xe1\xb8\x9d"              /* e with breve and cedilla */
+    "\xc8\x91"                  /* r with double grave */
+    "\xc5\xa1"                  /* s with caron */
+    "\xe1\xb8\xaf"              /* i with diaeresis and acute */
+    "\xe6"                      /* Invalid byte */
+    "\xe1\xb9\x8b";             /* n with circumflex below */
+
+  SVN_ERR_ASSERT(svn_utf__is_normalized(nfc, pool));
+  SVN_ERR_ASSERT(!svn_utf__is_normalized(nfd, pool));
+  SVN_ERR_ASSERT(!svn_utf__is_normalized(mixup, pool));
+  SVN_ERR_ASSERT(!svn_utf__is_normalized(invalid, pool));
+
+  return SVN_NO_ERROR;
+}
+
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,
@@ -636,5 +757,9 @@ struct svn_test_descriptor_t test_funcs[
                    "test svn_utf__normcmp"),
     SVN_TEST_PASS2(test_utf_pattern_match,
                    "test svn_utf__glob"),
+    SVN_TEST_PASS2(test_utf_fuzzy_escape,
+                   "test svn_utf__fuzzy_escape"),
+    SVN_TEST_PASS2(test_utf_is_normalized,
+                   "test svn_utf__is_normalized"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_wc/conflict-data-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_wc/conflict-data-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_wc/conflict-data-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_wc/conflict-data-test.c Wed Nov 27 11:52:35 2013
@@ -28,6 +28,7 @@
 #include <apr_hash.h>
 #include <apr_tables.h>
 
+#include "svn_private_config.h"
 #include "svn_props.h"
 #include "svn_pools.h"
 #include "svn_hash.h"
@@ -809,6 +810,8 @@ test_prop_conflicts(const svn_test_opts_
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/branches/verify-keep-going/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/libsvn_wc/db-test.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/libsvn_wc/db-test.c Wed Nov 27 11:52:35 2013
@@ -1521,6 +1521,8 @@ test_externals_store(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+int svn_test_max_threads = 2;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,



Mime
View raw message