You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/10/15 10:52:18 UTC

svn commit: r1532250 [34/37] - in /subversion/branches/cache-server: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ contrib/client-side/emacs/ contrib/hook-scripts/ contrib/server-side/fsfsfixer/ contrib/se...

Modified: subversion/branches/cache-server/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/cmdline/svntest/main.py?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/cache-server/subversion/tests/cmdline/svntest/main.py Tue Oct 15 08:52:06 2013
@@ -561,7 +561,8 @@ def run_command_stdin(command, error_exp
          stderr_lines
 
 def create_config_dir(cfgdir, config_contents=None, server_contents=None,
-                      ssl_cert=None, ssl_url=None, http_proxy=None):
+                      ssl_cert=None, ssl_url=None, http_proxy=None,
+                      exclusive_wc_locks=None):
   "Create config directories and files"
 
   # config file names
@@ -582,25 +583,41 @@ password-stores =
 [miscellany]
 interactive-conflicts = false
 """
-
+    if exclusive_wc_locks:
+      config_contents += """
+[working-copy]
+exclusive-locking = true
+"""
   # define default server file contents if none provided
   if server_contents is None:
     http_library_str = ""
     if options.http_library:
       http_library_str = "http-library=%s" % (options.http_library)
     http_proxy_str = ""
+    http_proxy_username_str = ""
+    http_proxy_password_str = ""
     if options.http_proxy:
       http_proxy_parsed = urlparse("//" + options.http_proxy)
       http_proxy_str = "http-proxy-host=%s\n" % (http_proxy_parsed.hostname) + \
                        "http-proxy-port=%d" % (http_proxy_parsed.port or 80)
+    if options.http_proxy_username:
+      http_proxy_username_str = "http-proxy-username=%s" % \
+                                     (options.http_proxy_username)
+    if options.http_proxy_password:
+      http_proxy_password_str = "http-proxy-password=%s" % \
+                                     (options.http_proxy_password)
+
     server_contents = """
 #
 [global]
 %s
 %s
+%s
+%s
 store-plaintext-passwords=yes
 store-passwords=yes
-""" % (http_library_str, http_proxy_str)
+""" % (http_library_str, http_proxy_str, http_proxy_username_str,
+       http_proxy_password_str)
 
   file_write(cfgfile_cfg, config_contents)
   file_write(cfgfile_srv, server_contents)
@@ -783,9 +800,11 @@ def run_atomic_ra_revprop_change(url, re
                      url, revision, propname, skel,
                      want_error and 1 or 0, default_config_dir)
 
-def run_wc_lock_tester(recursive, path):
+def run_wc_lock_tester(recursive, path, work_queue=False):
   "Run the wc-lock obtainer tool, returning its exit code, stdout and stderr"
-  if recursive:
+  if work_queue:
+    option = "-w"
+  elif recursive:
     option = "-r"
   else:
     option = "-1"
@@ -1311,6 +1330,9 @@ def is_fs_type_fsfs():
   # This assumes that fsfs is the default fs implementation.
   return options.fs_type == 'fsfs' or options.fs_type is None
 
+def is_fs_type_fsx():
+  return options.fs_type == 'fsx'
+
 def is_fs_type_bdb():
   return options.fs_type == 'bdb'
 
@@ -1356,6 +1378,9 @@ def server_enforces_date_syntax():
 def server_has_atomic_revprop():
   return options.server_minor_version >= 7
 
+def server_has_reverse_get_file_revs():
+  return options.server_minor_version >= 8
+
 def is_plaintext_password_storage_disabled():
   try:
     predicate = re.compile("^WARNING: Plaintext password storage is enabled!")
@@ -1424,6 +1449,12 @@ class TestSpawningThread(threading.Threa
       args.append('--ssl-cert=' + options.ssl_cert)
     if options.http_proxy:
       args.append('--http-proxy=' + options.http_proxy)
+    if options.http_proxy_username:
+      args.append('--http-proxy-username=' + options.http_proxy_username)
+    if options.http_proxy_password:
+      args.append('--http-proxy-password=' + options.http_proxy_password)
+    if options.exclusive_wc_locks:
+      args.append('--exclusive-wc-locks')
 
     result, stdout_lines, stderr_lines = spawn_process(command, 0, False, None,
                                                        *args)
@@ -1725,7 +1756,7 @@ def _create_parser():
   parser.add_option('--url', action='store',
                     help='Base url to the repos (e.g. svn://localhost)')
   parser.add_option('--fs-type', action='store',
-                    help='Subversion file system type (fsfs or bdb)')
+                    help='Subversion file system type (fsfs, bdb or fsx)')
   parser.add_option('--cleanup', action='store_true',
                     help='Whether to clean up')
   parser.add_option('--enable-sasl', action='store_true',
@@ -1769,8 +1800,14 @@ def _create_parser():
                     help='Path to SSL server certificate.')
   parser.add_option('--http-proxy', action='store',
                     help='Use the HTTP Proxy at hostname:port.')
+  parser.add_option('--http-proxy-username', action='store',
+                    help='Username for the HTTP Proxy.')
+  parser.add_option('--http-proxy-password', action='store',
+                    help='Password for the HTTP Proxy.')
   parser.add_option('--tools-bin', action='store', dest='tools_bin',
                     help='Use the svn tools installed in this path')
+  parser.add_option('--exclusive-wc-locks', action='store_true',
+                    help='Use sqlite exclusive locking for working copies')
 
   # most of the defaults are None, but some are other values, set them here
   parser.set_defaults(
@@ -1992,7 +2029,7 @@ def execute_tests(test_list, serial_only
         # it to a number if possible
         for testnum in list(range(1, len(test_list))):
           test_case = TestRunner(test_list[testnum], testnum)
-          if test_case.get_function_name() == str(arg):
+          if test_case.get_function_name() == str(arg).rstrip(','):
             testnums.append(testnum)
             appended = True
             break
@@ -2092,7 +2129,8 @@ def execute_tests(test_list, serial_only
     create_config_dir(default_config_dir,
                       ssl_cert=options.ssl_cert,
                       ssl_url=options.test_area_url,
-                      http_proxy=options.http_proxy)
+                      http_proxy=options.http_proxy,
+                      exclusive_wc_locks=options.exclusive_wc_locks)
 
     # Setup the pristine repository
     svntest.actions.setup_pristine_greek_repository()

Modified: subversion/branches/cache-server/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/cmdline/svntest/sandbox.py?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/branches/cache-server/subversion/tests/cmdline/svntest/sandbox.py Tue Oct 15 08:52:06 2013
@@ -362,6 +362,13 @@ class Sandbox:
        DEST is a relpath relative to the WC."""
     open(self.ospath(dest), truncate and 'w' or 'a').write(contents)
 
+  def simple_lock(self, *targets):
+    """Lock TARGETS in the WC.
+       TARGETS are relpaths relative to the WC."""
+    assert len(targets) > 0
+    targets = self.ospaths(targets)
+    svntest.main.run_svn(False, 'lock', *targets)
+
 
 def is_url(target):
   return (target.startswith('^/')
@@ -389,7 +396,7 @@ def _cleanup_test_path(path, retrying=Fa
     logger.info("CLEANUP: %s", path)
 
   try:
-    svntest.main.safe_rmtree(path)
+    svntest.main.safe_rmtree(path, retrying)
   except:
     logger.info("WARNING: cleanup failed, will try again later")
     _deferred_test_paths.append(path)

Modified: subversion/branches/cache-server/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/cmdline/switch_tests.py?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/cache-server/subversion/tests/cmdline/switch_tests.py Tue Oct 15 08:52:06 2013
@@ -41,7 +41,6 @@ Wimp = svntest.testcase.Wimp_deco
 Item = svntest.wc.StateItem
 
 from svntest.main import SVN_PROP_MERGEINFO, server_has_mergeinfo
-from externals_tests import change_external
 
 
 ### Bummer.  It would be really nice to have easy access to the URL
@@ -633,7 +632,7 @@ def nonrecursive_switching(sbox):
                        'up', wc1_dir)
   svntest.main.file_append(wc1_new_file, "This is the file 'newfile'.\n")
   svntest.main.run_svn(None, 'add', wc1_new_file)
-  svntest.main.run_svn(None, 'ci', '-m', '', wc1_dir)
+  sbox.simple_commit()
 
   # Try to switch "wc2" to the branch (non-recursively)
   svntest.actions.run_and_verify_svn(None, None, [], 'switch', '-N',
@@ -1976,24 +1975,18 @@ def switch_to_dir_with_peg_rev(sbox):
   X_path = sbox.ospath('X')
   Y_path = sbox.ospath('Y')
   svntest.main.run_svn(None, 'mkdir', X_path, Y_path)
-  svntest.main.run_svn(None, 'ci',
-                       '-m', 'log message',
-                       wc_dir)
+  sbox.simple_commit(message='log message')
 
   # change tau in rev. 3
   ADG_path = sbox.ospath('A/D/G')
   tau_path = os.path.join(ADG_path, 'tau')
   svntest.main.file_append(tau_path, "new line\n")
-  svntest.main.run_svn(None, 'ci',
-                       '-m', 'log message',
-                       wc_dir)
+  sbox.simple_commit(message='log message')
 
   # delete A/D/G in rev. 4
   svntest.main.run_svn(None, 'up', wc_dir)
   svntest.main.run_svn(None, 'rm', ADG_path)
-  svntest.main.run_svn(None, 'ci',
-                       '-m', 'log message',
-                       wc_dir)
+  sbox.simple_commit(message='log message')
 
   # Test 1: switch X to A/D/G@2
   ADG_url = repo_url + '/A/D/G'
@@ -2047,7 +2040,7 @@ def switch_urls_with_spaces(sbox):
   svntest.main.file_write(bbb_path, "This is the file 'bar baz bal'.\n")
   svntest.main.run_svn(None, 'add', tpm_path, bbb_path)
 
-  svntest.main.run_svn(None, 'ci', '-m', 'log message', wc_dir)
+  sbox.simple_commit(message='log message')
 
   # Test 1: switch directory 'A B C' to url 'X Y Z'
   XYZ_url = repo_url + '/X Y Z'
@@ -2112,23 +2105,19 @@ def switch_to_dir_with_peg_rev2(sbox):
   # prepare dir X in rev. 2
   X_path = sbox.ospath('X')
   svntest.main.run_svn(None, 'mkdir', X_path)
-  svntest.main.run_svn(None, 'ci',
-                       '-m', 'log message',
-                       wc_dir)
+  sbox.simple_commit(message='log message')
 
   # make a change in ADG in rev. 3
   tau_path = sbox.ospath('A/D/G/tau')
   svntest.main.file_append(tau_path, "extra line\n")
-  svntest.main.run_svn(None, 'ci', '-m', 'log message', wc_dir)
+  sbox.simple_commit(message='log message')
 
   # Rename ADG to ADY in rev 4
   svntest.main.run_svn(None, 'up', wc_dir)
   ADG_path = sbox.ospath('A/D/G')
   ADY_path = sbox.ospath('A/D/Y')
   svntest.main.run_svn(None, 'mv', ADG_path, ADY_path)
-  svntest.main.run_svn(None, 'ci',
-                       '-m', 'log message',
-                       wc_dir)
+  sbox.simple_commit(message='log message')
 
   # Test switch X to rev 2 of A/D/Y@HEAD
   ADY_url = sbox.repo_url + '/A/D/Y'
@@ -2245,7 +2234,7 @@ def tolerate_local_mods(sbox):
 
   os.mkdir(L_path)
   svntest.main.run_svn(None, 'add', L_path)
-  svntest.main.run_svn(None, 'ci', '-m', 'Commit added folder', wc_dir)
+  sbox.simple_commit(message='Commit added folder')
 
   # locally modified unversioned file
   svntest.main.file_write(LM_path, 'Locally modified file.\n', 'w+')
@@ -2807,12 +2796,12 @@ def copy_with_switched_subdir(sbox):
 
   svntest.actions.run_and_verify_status(wc_dir, state)
 
-  svntest.main.run_svn(None, 'ci', '-m', 'Commit added folder', wc_dir)
+  sbox.simple_commit(message='Commit added folder')
 
   # Additional test, it should commit to R/G/alpha.
   svntest.main.run_svn(None, 'up', wc_dir)
   svntest.main.file_append(sbox.ospath('R/G/alpha'), "apple")
-  svntest.main.run_svn(None, 'ci', '-m', 'Commit changed file', wc_dir)
+  sbox.simple_commit(message='Commit changed file')
 
   # Checkout working copy to verify result
   svntest.main.safe_rmtree(wc_dir, 1)

Modified: subversion/branches/cache-server/subversion/tests/cmdline/tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/cmdline/tree_conflict_tests.py?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/cmdline/tree_conflict_tests.py (original)
+++ subversion/branches/cache-server/subversion/tests/cmdline/tree_conflict_tests.py Tue Oct 15 08:52:06 2013
@@ -1023,7 +1023,7 @@ def up_add_onto_add_revert(sbox):
   main.run_svn(None, 'cp', os.path.join(wc_dir, 'A/C'), dir1)
   main.run_svn(None, 'cp', os.path.join(wc2_dir, 'A/C'), dir2)
 
-  main.run_svn(None, 'ci', wc_dir, '-m', 'Added file')
+  sbox.simple_commit(message='Added file')
 
   expected_disk = main.greek_state.copy()
   expected_disk.add({
@@ -1455,6 +1455,67 @@ def update_dir_with_not_present(sbox):
   run_and_verify_svn(None, None, [],
                      'ci', '-m', '', wc_dir)
 
+@XFail()
+def update_delete_mixed_rev(sbox):
+  "update that deletes mixed-rev"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  sbox.simple_move('A/B/E/alpha', 'A/B/E/alpha2')
+  sbox.simple_commit()
+  sbox.simple_update()
+  sbox.simple_rm('A/B')
+  sbox.simple_commit()
+  sbox.simple_update(revision=1)
+  sbox.simple_update(target='A/B/E', revision=2)
+  sbox.simple_mkdir('A/B/E2')
+
+  # Update raises a tree conflict on A/B due to local mod A/B/E2
+  expected_output = wc.State(wc_dir, {
+      'A/B' : Item(status='  ', treeconflict='C'),
+      })
+  expected_disk = main.greek_state.copy()
+  expected_disk.add({
+      'A/B/E2'       : Item(),
+      'A/B/E/alpha2' : Item(contents='This is the file \'alpha\'.\n'),
+    })
+  expected_disk.remove('A/B/E/alpha')
+  expected_status = get_virginal_state(wc_dir, 3)
+  expected_status.remove('A/B/E/alpha')
+  expected_status.add({
+      'A/B/E2'       : Item(status='A ', wc_rev='-'),
+      'A/B/E/alpha2' : Item(status='  ', copied='+', wc_rev='-'),
+      })
+  expected_status.tweak('A/B',
+                        status='A ', copied='+', treeconflict='C', wc_rev='-')
+  expected_status.tweak('A/B/F', 'A/B/E', 'A/B/E/beta', 'A/B/lambda',
+                        copied='+', wc_rev='-')
+  run_and_verify_update(wc_dir,
+                        expected_output, expected_disk, expected_status,
+                        None, None, None, None, None, 1,
+                        wc_dir)
+
+  # Resolving to working state should give a mixed-revision copy that
+  # gets committed as multiple copies
+  run_and_verify_resolved([sbox.ospath('A/B')], sbox.ospath('A/B'))
+  expected_output = wc.State(wc_dir, {
+      'A/B'    : Item(verb='Adding'),
+      'A/B/E'  : Item(verb='Replacing'),
+      'A/B/E2' : Item(verb='Adding'),
+      })
+  expected_status.tweak('A/B', 'A/B/E', 'A/B/E2', 'A/B/F', 'A/B/E/alpha2',
+                        'A/B/E/beta', 'A/B/lambda',
+                        status='  ', wc_rev=4, copied=None, treeconflict=None)
+  run_and_verify_commit(wc_dir,
+                        expected_output, expected_status, None,
+                        wc_dir)
+
+  expected_info = {
+    'Name': 'alpha2',
+    'Node Kind': 'file',
+  }
+  run_and_verify_info([expected_info], sbox.repo_url + '/A/B/E/alpha2')
+
 #######################################################################
 # Run the tests
 
@@ -1485,6 +1546,7 @@ test_list = [ None,
               at_directory_external,
               actual_only_node_behaviour,
               update_dir_with_not_present,
+              update_delete_mixed_rev,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/cache-server/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/cmdline/update_tests.py?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/cache-server/subversion/tests/cmdline/update_tests.py Tue Oct 15 08:52:06 2013
@@ -34,8 +34,8 @@ logger = logging.getLogger()
 # Our testing module
 import svntest
 from svntest import wc, actions, verify, deeptrees
-from merge_tests import expected_merge_output
-from merge_tests import set_up_branch
+from svntest.mergetrees import expected_merge_output
+from svntest.mergetrees import set_up_branch
 
 # (abbreviation)
 Skip = svntest.testcase.Skip_deco

Modified: subversion/branches/cache-server/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/cmdline/upgrade_tests.py?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/cache-server/subversion/tests/cmdline/upgrade_tests.py Tue Oct 15 08:52:06 2013
@@ -430,7 +430,10 @@ def basic_upgrade_1_0(sbox):
 
   url = sbox.repo_url
 
-  xml_entries_relocate(sbox.wc_dir, 'file:///1.0.0/repos', url)
+  # This is non-canonical by the rules of svn_uri_canonicalize, it gets
+  # written into the entries file and upgrade has to canonicalize.
+  non_canonical_url = url[:-1] + '%%%02x' % ord(url[-1])
+  xml_entries_relocate(sbox.wc_dir, 'file:///1.0.0/repos', non_canonical_url)
 
   # Attempt to use the working copy, this should give an error
   expected_stderr = wc_is_too_old_regex
@@ -1408,6 +1411,23 @@ def iprops_upgrade1_6(sbox):
                     'iprops_upgrade_root1_6.tar.bz2',
                     sbox)
 
+def changelist_upgrade_1_6(sbox):
+  "upgrade from 1.6 with changelist"
+
+  sbox.build(create_wc = False)
+  svntest.main.run_svnadmin('setuuid', sbox.repo_dir,
+                            'aa4c97bd-2e1a-4e55-a1e5-3db22cff2673')
+  replace_sbox_with_tarfile(sbox, 'changelist_upgrade_1_6.tar.bz2')
+  svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
+
+  exit_code, output, errput = svntest.main.run_svn(None, 'info', sbox.wc_dir,
+                                                   '--depth', 'infinity',
+                                                   '--changelist', 'foo')
+  paths = [x for x in output if x[:6] == 'Path: ']
+  expected_paths = ['Path: %s\n' % sbox.ospath('A/D/gamma')]
+  if paths != expected_paths:
+    raise svntest.Failure("changelist not matched")
+
 ########################################################################
 # Run the tests
 
@@ -1462,6 +1482,7 @@ test_list = [ None,
               upgrade_from_1_7_conflict,
               iprops_upgrade,
               iprops_upgrade1_6,
+              changelist_upgrade_1_6,
              ]
 
 

Modified: subversion/branches/cache-server/subversion/tests/cmdline/wc_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/cmdline/wc_tests.py?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/cmdline/wc_tests.py (original)
+++ subversion/branches/cache-server/subversion/tests/cmdline/wc_tests.py Tue Oct 15 08:52:06 2013
@@ -42,6 +42,7 @@ Issues = svntest.testcase.Issues_deco
 Issue = svntest.testcase.Issue_deco
 Wimp = svntest.testcase.Wimp_deco
 Item = wc.StateItem
+UnorderedOutput = svntest.verify.UnorderedOutput
 
 ######################################################################
 # Tests
@@ -200,6 +201,162 @@ def cleanup_below_wc_root(sbox):
   svntest.actions.run_and_verify_svn("Cleanup below wc root", None, [],
                                      "cleanup", sbox.ospath("A"))
 
+@SkipUnless(svntest.main.is_posix_os)
+@Issue(4383)
+def update_through_unversioned_symlink(sbox):
+  """update through unversioned symlink"""
+
+  sbox.build(read_only = True)
+  wc_dir = sbox.wc_dir
+  state = svntest.actions.get_virginal_state(wc_dir, 1)
+  symlink = sbox.get_tempname()
+  os.symlink(os.path.abspath(sbox.wc_dir), symlink)
+  expected_output = []
+  expected_disk = []
+  expected_status = []
+  # Subversion 1.8.0 crashes when updating a working copy through a symlink
+  svntest.actions.run_and_verify_update(wc_dir, expected_output,
+                                        expected_disk, expected_status,
+                                        None, None, None, None, None, 1,
+                                        symlink)
+
+@Issue(3549)
+def cleanup_unversioned_items(sbox):
+  """cleanup --remove-unversioned / --remove-ignored"""
+
+  sbox.build(read_only = True)
+  wc_dir = sbox.wc_dir
+
+  # create some unversioned items
+  os.mkdir(sbox.ospath('dir1'))
+  os.mkdir(sbox.ospath('dir2'))
+  contents = "This is an unversioned file\n."
+  svntest.main.file_write(sbox.ospath('dir1/dir1_child1'), contents)
+  svntest.main.file_write(sbox.ospath('dir2/dir2_child1'), contents)
+  os.mkdir(sbox.ospath('dir2/foo_child2'))
+  svntest.main.file_write(sbox.ospath('file_foo'), contents),
+  os.mkdir(sbox.ospath('dir_foo'))
+  svntest.main.file_write(sbox.ospath('dir_foo/foo_child1'), contents)
+  os.mkdir(sbox.ospath('dir_foo/foo_child2'))
+  # a file that matches a default ignore pattern
+  svntest.main.file_write(sbox.ospath('foo.o'), contents)
+
+  # ignore some of the unversioned items
+  sbox.simple_propset('svn:ignore', '*_foo', '.')
+
+  os.chdir(wc_dir)
+
+  expected_output = [
+        ' M      .\n',
+        '?       dir1\n',
+        '?       dir2\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'status')
+  expected_output += [
+        'I       dir_foo\n',
+        'I       file_foo\n',
+        'I       foo.o\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'status', '--no-ignore')
+
+  expected_output = [
+        'D         dir1\n',
+        'D         dir2\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'cleanup', '--remove-unversioned')
+  expected_output = [
+        ' M      .\n',
+        'I       dir_foo\n',
+        'I       file_foo\n',
+        'I       foo.o\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'status', '--no-ignore')
+
+  # remove ignored items, with an empty global-ignores list
+  expected_output = [
+        'D         dir_foo\n',
+        'D         file_foo\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'cleanup', '--remove-ignored',
+                                     '--config-option',
+                                     'config:miscellany:global-ignores=')
+
+  # the file matching global-ignores should still be present
+  expected_output = [
+        ' M      .\n',
+        'I       foo.o\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'status', '--no-ignore')
+
+  # un-ignore the file matching global ignores, making it unversioned,
+  # and remove it with --remove-unversioned
+  expected_output = [
+        'D         foo.o\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'cleanup', '--remove-unversioned',
+                                     '--config-option',
+                                     'config:miscellany:global-ignores=')
+  expected_output = [
+        ' M      .\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, expected_output,
+                                     [], 'status', '--no-ignore')
+
+def cleanup_unversioned_items_in_locked_wc(sbox):
+  """cleanup unversioned items in locked WC should fail"""
+
+  sbox.build(read_only = True)
+
+  contents = "This is an unversioned file\n."
+  svntest.main.file_write(sbox.ospath('unversioned_file'), contents)
+
+  svntest.actions.lock_admin_dir(sbox.ospath(""), True)
+  for option in ['--remove-unversioned', '--remove-ignored']:
+    svntest.actions.run_and_verify_svn(None, None,
+                                       "svn: E155004: Working copy locked;.*",
+                                       "cleanup", option,
+                                       sbox.ospath(""))
+
+def cleanup_dir_external(sbox):
+  """cleanup --include-externals"""
+
+  sbox.build(read_only = True)
+
+  # configure a directory external
+  sbox.simple_propset("svn:externals", "^/A A_ext", ".")
+  sbox.simple_update()
+
+  svntest.actions.lock_admin_dir(sbox.ospath("A_ext"), True)
+  svntest.actions.run_and_verify_svn(None, ["Performing cleanup on external " +
+                                     "item at '%s'.\n" % sbox.ospath("A_ext")],
+                                     [], "cleanup", '--include-externals',
+                                     sbox.ospath(""))
+
+@Issue(4390)
+def checkout_within_locked_wc(sbox):
+  """checkout within a locked working copy"""
+
+  sbox.build(read_only = True)
+
+  # lock working copy and create outstanding work queue items
+  svntest.actions.lock_admin_dir(sbox.ospath(""), True, True)
+  expected_output = [
+  "A    %s\n" % sbox.ospath("nested-wc/alpha"),
+  "A    %s\n" % sbox.ospath("nested-wc/beta"),
+  "Checked out revision 1.\n"
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], "checkout", sbox.repo_url + '/A/B/E',
+                                     sbox.ospath("nested-wc"))
+
+
 ########################################################################
 # Run the tests
 
@@ -218,6 +375,11 @@ test_list = [ None,
               status_without_wc_db_and_entries,
               status_with_missing_wc_db_and_maybe_valid_entries,
               cleanup_below_wc_root,
+              update_through_unversioned_symlink,
+              cleanup_unversioned_items,
+              cleanup_unversioned_items_in_locked_wc,
+              cleanup_dir_external,
+              checkout_within_locked_wc,
              ]
 
 if __name__ == '__main__':

Propchange: subversion/branches/cache-server/subversion/tests/libsvn_client/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Oct 15 08:52:06 2013
@@ -5,3 +5,5 @@ test-patch*
 test-wc*
 test-copy-crash
 test-youngest-common-ancestor
+foreign-copy1
+foreign-copy2

Modified: subversion/branches/cache-server/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_client/client-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_client/client-test.c Tue Oct 15 08:52:06 2013
@@ -400,7 +400,7 @@ test_patch(const svn_test_opts_t *opts,
       SVN_ERR(svn_io_file_write(patch_file, unidiff_patch[i], &len, pool));
       SVN_TEST_ASSERT(len == strlen(unidiff_patch[i]));
     }
-  SVN_ERR(svn_io_file_flush_to_disk(patch_file, pool));
+  SVN_ERR(svn_io_file_flush(patch_file, pool));
 
   /* Apply the patch. */
   pcb.patched_tempfiles = apr_hash_make(pool);

Modified: subversion/branches/cache-server/subversion/tests/libsvn_delta/random-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_delta/random-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_delta/random-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_delta/random-test.c Tue Oct 15 08:52:06 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/branches/cache-server/subversion/tests/libsvn_delta/range-index-test.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_delta/range-index-test.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_delta/range-index-test.h (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_delta/range-index-test.h Tue Oct 15 08:52:06 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);

Modified: subversion/branches/cache-server/subversion/tests/libsvn_diff/diff-diff3-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_diff/diff-diff3-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_diff/diff-diff3-test.c Tue Oct 15 08:52:06 2013
@@ -2947,7 +2947,7 @@ struct svn_test_descriptor_t test_funcs[
     SVN_TEST_PASS2(test_identical_suffix,
                    "identical suffix starts at the boundary of a chunk"),
     SVN_TEST_PASS2(test_token_compare,
-                   "compare tokes at the chunk boundary"),
+                   "compare tokens at the chunk boundary"),
     SVN_TEST_PASS2(two_way_issue_3362_v1,
                    "2-way issue #3362 test v1"),
     SVN_TEST_PASS2(two_way_issue_3362_v2,

Propchange: subversion/branches/cache-server/subversion/tests/libsvn_fs/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Oct 15 08:52:06 2013
@@ -1,4 +1,5 @@
 .libs
+test-fs-*
 test-repo-*
 locks-test
 fs-test

Modified: subversion/branches/cache-server/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_fs/fs-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_fs/fs-test.c Tue Oct 15 08:52:06 2013
@@ -27,6 +27,8 @@
 
 #include "../svn_test.h"
 
+#include "svn_private_config.h"
+#include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_time.h"
 #include "svn_string.h"
@@ -3755,6 +3757,17 @@ small_file_integrity(const svn_test_opts
 
 
 static svn_error_t *
+almostmedium_file_integrity(const svn_test_opts_t *opts,
+                            apr_pool_t *pool)
+{
+  apr_uint32_t seed = (apr_uint32_t) apr_time_now();
+
+  return file_integrity_helper(SVN_DELTA_WINDOW_SIZE - 1, &seed, opts,
+                               "test-repo-almostmedium-file-integrity", pool);
+}
+
+
+static svn_error_t *
 medium_file_integrity(const svn_test_opts_t *opts,
                       apr_pool_t *pool)
 {
@@ -4935,7 +4948,7 @@ delete_fs(const svn_test_opts_t *opts,
   return SVN_NO_ERROR;
 }
 
-/* Issue 4340, "fs layer should reject filenames with trailing \n" */
+/* Issue 4340, "filenames containing \n corrupt FSFS repositories" */
 static svn_error_t *
 filename_trailing_newline(const svn_test_opts_t *opts,
                           apr_pool_t *pool)
@@ -4946,12 +4959,14 @@ filename_trailing_newline(const svn_test
   svn_fs_root_t *txn_root, *root;
   svn_revnum_t youngest_rev = 0;
   svn_error_t *err;
-  svn_boolean_t allow_newlines;
+  svn_boolean_t legacy_backend;
+  static const char contents[] = "foo\003bar";
 
-  /* Some filesystem implementations can handle newlines in filenames
-   * and can be white-listed here.
-   * Currently, only BDB supports \n in filenames. */
-  allow_newlines = (strcmp(opts->fs_type, "bdb") == 0);
+  /* The FS API wants \n to be permitted, but FSFS never implemented that,
+   * so for FSFS we expect errors rather than successes in some of the commits.
+   * Use a blacklist approach so that new FSes default to implementing the API
+   * as originally defined. */
+  legacy_backend = (!strcmp(opts->fs_type, SVN_FS_TYPE_FSFS));
 
   SVN_ERR(svn_test__create_fs(&fs, "test-repo-filename-trailing-newline",
                               opts, pool));
@@ -4969,17 +4984,59 @@ filename_trailing_newline(const svn_test
   SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
   SVN_ERR(svn_fs_revision_root(&root, fs, youngest_rev, subpool));
   err = svn_fs_copy(root, "/foo", txn_root, "/bar\n", subpool);
-  if (allow_newlines)
+  if (!legacy_backend)
     SVN_TEST_ASSERT(err == SVN_NO_ERROR);
   else
     SVN_TEST_ASSERT_ERROR(err, SVN_ERR_FS_PATH_SYNTAX);
 
   /* Attempt to create a file /foo/baz\n. This should fail on FSFS. */
   err = svn_fs_make_file(txn_root, "/foo/baz\n", subpool);
-  if (allow_newlines)
+  if (!legacy_backend)
     SVN_TEST_ASSERT(err == SVN_NO_ERROR);
   else
     SVN_TEST_ASSERT_ERROR(err, SVN_ERR_FS_PATH_SYNTAX);
+  
+
+  /* Create another file, with contents. */
+  if (!legacy_backend)
+    {
+      SVN_ERR(svn_fs_make_file(txn_root, "/bar\n/baz\n", subpool));
+      SVN_ERR(svn_test__set_file_contents(txn_root, "bar\n/baz\n",
+                                          contents, pool));
+    }
+
+  if (!legacy_backend)
+    {
+      svn_revnum_t after_rev;
+      static svn_test__tree_entry_t expected_entries[] = {
+        { "foo", NULL },
+        { "bar\n", NULL },
+        { "foo/baz\n", "" },
+        { "bar\n/baz\n", contents },
+        { NULL, NULL }
+      };
+      const char *expected_changed_paths[] = {
+        "/bar\n",
+        "/foo/baz\n",
+        "/bar\n/baz\n",
+        NULL
+      };
+      apr_hash_t *expected_changes = apr_hash_make(pool);
+      int i;
+
+      SVN_ERR(svn_fs_commit_txn(NULL, &after_rev, txn, subpool));
+      SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(after_rev));
+
+      /* Validate the DAG. */
+      SVN_ERR(svn_fs_revision_root(&root, fs, after_rev, pool));
+      SVN_ERR(svn_test__validate_tree(root, expected_entries, 4, pool));
+
+      /* Validate changed-paths, where the problem originally occurred. */
+      for (i = 0; expected_changed_paths[i]; i++)
+        svn_hash_sets(expected_changes, expected_changed_paths[i],
+                      "undefined value");
+      SVN_ERR(svn_test__validate_changes(root, expected_changes, pool));
+    }
 
   return SVN_NO_ERROR;
 }
@@ -4992,15 +5049,27 @@ test_fs_info_format(const svn_test_opts_
   int fs_format;
   svn_version_t *supports_version;
   svn_version_t v1_5_0 = {1, 5, 0, ""};
+  svn_version_t v1_9_0 = {1, 9, 0, ""};
   svn_test_opts_t opts2;
+  svn_boolean_t is_fsx = strcmp(opts->fs_type, "fsx") == 0;
 
   opts2 = *opts;
-  opts2.server_minor_version = 5;
+  opts2.server_minor_version = is_fsx ? 9 : 5;
 
   SVN_ERR(svn_test__create_fs(&fs, "test-fs-format-info", &opts2, pool));
   SVN_ERR(svn_fs_info_format(&fs_format, &supports_version, fs, pool, pool));
-  SVN_TEST_ASSERT(fs_format == 3); /* happens to be the same for FSFS and BDB */
-  SVN_TEST_ASSERT(svn_ver_equal(supports_version, &v1_5_0));
+
+  if (is_fsx)
+    {
+      SVN_TEST_ASSERT(fs_format == 1);
+      SVN_TEST_ASSERT(svn_ver_equal(supports_version, &v1_9_0));
+    }
+  else
+    {
+       /* happens to be the same for FSFS and BDB */
+      SVN_TEST_ASSERT(fs_format == 3);
+      SVN_TEST_ASSERT(svn_ver_equal(supports_version, &v1_5_0));
+    }
 
   return SVN_NO_ERROR;
 }
@@ -5055,6 +5124,8 @@ struct svn_test_descriptor_t test_funcs[
                        "check old revisions"),
     SVN_TEST_OPTS_PASS(check_all_revisions,
                        "after each commit, check all revisions"),
+    SVN_TEST_OPTS_PASS(almostmedium_file_integrity,
+                       "create and modify almostmedium file"),
     SVN_TEST_OPTS_PASS(medium_file_integrity,
                        "create and modify medium file"),
     SVN_TEST_OPTS_PASS(large_file_integrity,

Propchange: subversion/branches/cache-server/subversion/tests/libsvn_fs_fs/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Oct 15 08:52:06 2013
@@ -3,10 +3,10 @@ Release
 .libs
 test-repo-*
 fs-pack-test
+fs-fs-pack-test
 test-get-set-revprop-packed-fs
 *.o
 *.lo
 *~
 .*~
 *.exe
-

Propchange: subversion/branches/cache-server/subversion/tests/libsvn_fs_x/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Oct 15 08:52:06 2013
@@ -0,0 +1,12 @@
+Debug
+Release
+.libs
+test-repo-*
+fs-x-pack-test
+string-table-test
+test-get-set-revprop-packed-fs
+*.o
+*.lo
+*~
+.*~
+*.exe

Propchange: subversion/branches/cache-server/subversion/tests/libsvn_fs_x/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Oct 15 08:52:06 2013
@@ -0,0 +1,81 @@
+/subversion/branches/1.5.x-r30215/subversion/tests/libsvn_fs_x:870312
+/subversion/branches/1.7.x-fs-verify/subversion/tests/libsvn_fs_x:1146708,1161180
+/subversion/branches/10Gb/subversion/tests/libsvn_fs_x:1388102,1388163-1388190,1388195,1388202,1388205,1388211,1388276,1388362,1388375,1388394,1388636,1388639-1388640,1388643-1388644,1388654,1388720,1388789,1388795,1388801,1388805,1388807,1388810,1388816,1389044,1389276,1389289,1389662,1389867,1390017,1390209,1390216,1390407,1390409,1390414,1390419,1390955
+/subversion/branches/atomic-revprop/subversion/tests/libsvn_fs_x:965046-1000689
+/subversion/branches/auto-props-sdc/subversion/tests/libsvn_fs_x:1384106-1401643
+/subversion/branches/bdb-reverse-deltas/subversion/tests/libsvn_fs_x:872050-872529
+/subversion/branches/cache-server/subversion/tests/libsvn_fs_x:1458643-1476567
+/subversion/branches/diff-callbacks3/subversion/tests/libsvn_fs_x:870059-870761
+/subversion/branches/diff-optimizations/subversion/tests/libsvn_fs_x:1031270-1037352
+/subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_fs_x:1037353-1067789
+/subversion/branches/dont-save-plaintext-passwords-by-default/subversion/tests/libsvn_fs_x:870728-871118
+/subversion/branches/double-delete/subversion/tests/libsvn_fs_x:870511-872970
+/subversion/branches/ev2-export/subversion/tests/libsvn_fs_x:1325914,1332738,1413107
+/subversion/branches/explore-wc/subversion/tests/libsvn_fs_x:875486,875493,875497,875507,875511,875514,875559,875580-875581,875584,875587,875611,875627,875647,875667-875668,875711-875712,875733-875734,875736,875744-875748,875751,875758,875782,875795-875796,875830,875836,875838,875842,875852,875855,875864,875870,875873,875880,875885-875888,875890,875897-875898,875905,875907-875909,875935,875943-875944,875946,875979,875982-875983,875985-875986,875990,875997
+/subversion/branches/file-externals/subversion/tests/libsvn_fs_x:871779-873302
+/subversion/branches/fs-rep-sharing/subversion/tests/libsvn_fs_x:869036-873803
+/subversion/branches/fsfs-format7/subversion/tests/libsvn_fs_x:1426304,1430673,1433848,1438408,1438982,1441129,1442051,1442068,1442504,1442910,1443171,1443803,1444690,1444693,1444695,1445040,1445080,1446103,1451129,1453590,1454307,1460579,1461851,1461865,1462837,1462904,1463120,1467362,1467382,1469487,1471208,1477166,1478055,1481447,1489817,1489949,1490673-1490674,1491784,1493042,1498029,1498103,1498155,1500054,1507729-1507731,1507735-1507736
+/subversion/branches/fsfs-improvements/subversion/tests/libsvn_fs_x:1499981-1517476
+/subversion/branches/fsfs-pack/subversion/tests/libsvn_fs_x:873717-874575
+/subversion/branches/fsx/subversion/tests/libsvn_fs_x:1507845-1509914
+/subversion/branches/gnome-keyring/subversion/tests/libsvn_fs_x:870558-871410
+/subversion/branches/gpg-agent-password-store/subversion/tests/libsvn_fs_x:1005036-1150766
+/subversion/branches/gtest_addition/subversion/tests/libsvn_fs_x:1452117-1502138
+/subversion/branches/http-protocol-v2/subversion/tests/libsvn_fs_x:874395-876041
+/subversion/branches/in-memory-cache/subversion/tests/libsvn_fs_x:869829-871452
+/subversion/branches/in-repo-authz/subversion/tests/libsvn_fs_x:1414342-1424779
+/subversion/branches/inheritable-props/subversion/tests/libsvn_fs_x:1297080-1395089
+/subversion/branches/integrate-cache-item-serialization/subversion/tests/libsvn_fs_x:1068724-1068739
+/subversion/branches/integrate-cache-membuffer/subversion/tests/libsvn_fs_x:998649-998852
+/subversion/branches/integrate-compression-level/subversion/tests/libsvn_fs_x:1068651-1072287
+/subversion/branches/integrate-io-improvements/subversion/tests/libsvn_fs_x:1068684-1072297
+/subversion/branches/integrate-is-cachable/subversion/tests/libsvn_fs_x:1072568-1074082
+/subversion/branches/integrate-partial-getter/subversion/tests/libsvn_fs_x:1072558-1076552
+/subversion/branches/integrate-readline-speedup/subversion/tests/libsvn_fs_x:1072553-1072555
+/subversion/branches/integrate-stream-api-extensions/subversion/tests/libsvn_fs_x:1068695-1072516
+/subversion/branches/integrate-string-improvements/subversion/tests/libsvn_fs_x:1068251-1190617
+/subversion/branches/integrate-txdelta-caching/subversion/tests/libsvn_fs_x:1072541-1078213
+/subversion/branches/issue-2779-dev/subversion/tests/libsvn_fs_x:965496-984198
+/subversion/branches/issue-2843-dev/subversion/tests/libsvn_fs_x:871432-874179
+/subversion/branches/issue-3000/subversion/tests/libsvn_fs_x:871713,871716-871719,871721-871726,871728,871734
+/subversion/branches/issue-3067-deleted-subtrees/subversion/tests/libsvn_fs_x:873375-874084
+/subversion/branches/issue-3148-dev/subversion/tests/libsvn_fs_x:875193-875204
+/subversion/branches/issue-3220-dev/subversion/tests/libsvn_fs_x:872210-872226
+/subversion/branches/issue-3242-dev/subversion/tests/libsvn_fs_x:879653-896436
+/subversion/branches/issue-3334-dirs/subversion/tests/libsvn_fs_x:875156-875867
+/subversion/branches/issue-3975/subversion/tests/libsvn_fs_x:1152931-1160746
+/subversion/branches/issue-4116-dev/subversion/tests/libsvn_fs_x:1424719-1425040
+/subversion/branches/issue-4194-dev/subversion/tests/libsvn_fs_x:1410507-1414880
+/subversion/branches/javahl-ra/subversion/tests/libsvn_fs_x:991978-1494640
+/subversion/branches/kwallet/subversion/tests/libsvn_fs_x:870785-871314
+/subversion/branches/log-g-performance/subversion/tests/libsvn_fs_x:870941-871032
+/subversion/branches/merge-skips-obstructions/subversion/tests/libsvn_fs_x:874525-874615
+/subversion/branches/multi-layer-moves/subversion/tests/libsvn_fs_x:1239019-1300930
+/subversion/branches/nfc-nfd-aware-client/subversion/tests/libsvn_fs_x:870276,870376
+/subversion/branches/node_pool/subversion/tests/libsvn_fs_x:1304828-1305388
+/subversion/branches/performance/subversion/tests/libsvn_fs_x:979193,980118,981087,981090,981189,981194,981287,981684,981827,982043,982355,983398,983406,983430,983474,983488,983490,983760,983764,983766,983770,984927,984973,984984,985014,985037,985046,985472,985477,985482,985487-985488,985493,985497,985500,985514,985601,985603,985606,985669,985673,985695,985697,986453,986465,986485,986491-986492,986517,986521,986605,986608,986817,986832,987865,987868-987869,987872,987886-987888,987893,988319,988898,990330,990533,990535-990537,990541,990568,990572,990574-990575,990600,990759,992899,992904,992911,993127,993141,994956,995478,995507,995603,998012,998858,999098,1001413,1001417,1004291,1022668,1022670,1022676,1022715,1022719,1025660,1025672,1027193,1027203,1027206,1027214,1027227,1028077,1028092,1028094,1028104,1028107,1028111,1028354,1029038,1029042-1029043,1029054-1029055,1029062-1029063,1029078,1029080,1029090,1029092-1029093,1029111,1029151,1029158,1029229-1029230,1029232,1029335-10293
 36,1029339-1029340,1029342,1029344,1030763,1030827,1031203,1031235,1032285,1032333,1033040,1033057,1033294,1035869,1035882,1039511,1043705,1053735,1056015,1066452,1067683,1067697-1078365
+/subversion/branches/py-tests-as-modules/subversion/tests/libsvn_fs_x:956579-1033052
+/subversion/branches/ra_serf-digest-authn/subversion/tests/libsvn_fs_x:875693-876404
+/subversion/branches/reintegrate-improvements/subversion/tests/libsvn_fs_x:873853-874164
+/subversion/branches/revprop-cache/subversion/tests/libsvn_fs_x:1298521-1326293
+/subversion/branches/revprop-packing/subversion/tests/libsvn_fs_x:1143907,1143971,1143997,1144017,1144499,1144568,1146145
+/subversion/branches/subtree-mergeinfo/subversion/tests/libsvn_fs_x:876734-878766
+/subversion/branches/svn-mergeinfo-enhancements/subversion/tests/libsvn_fs_x:870119-870195,870197-870288
+/subversion/branches/svn-patch-improvements/subversion/tests/libsvn_fs_x:918519-934609
+/subversion/branches/svn_mutex/subversion/tests/libsvn_fs_x:1141683-1182099
+/subversion/branches/svnpatch-diff/subversion/tests/libsvn_fs_x:865738-876477
+/subversion/branches/svnraisetc/subversion/tests/libsvn_fs_x:874709-875149
+/subversion/branches/svnserve-logging/subversion/tests/libsvn_fs_x:869828-870893
+/subversion/branches/tc-issue-3334/subversion/tests/libsvn_fs_x:874697-874773
+/subversion/branches/tc-merge-notify/subversion/tests/libsvn_fs_x:874017-874062
+/subversion/branches/tc-resolve/subversion/tests/libsvn_fs_x:874191-874239
+/subversion/branches/tc_url_rev/subversion/tests/libsvn_fs_x:874351-874483
+/subversion/branches/tree-conflicts/subversion/tests/libsvn_fs_x:868291-873154
+/subversion/branches/tree-conflicts-notify/subversion/tests/libsvn_fs_x:873926-874008
+/subversion/branches/tristate-chunked-request/subversion/tests/libsvn_fs_x:1502394-1502681
+/subversion/branches/tweak-build-take-two/subversion/tests/libsvn_fs_x:1424288-1425049,1425051-1425613
+/subversion/branches/uris-as-urls/subversion/tests/libsvn_fs_x:1060426-1064427
+/subversion/branches/verify-at-commit/subversion/tests/libsvn_fs_x:1462039-1462408
+/subversion/branches/verify-keep-going/subversion/tests/libsvn_fs_x:1439280-1492639
+/subversion/branches/wc-collate-path/subversion/tests/libsvn_fs_x:1402685-1480384
+/subversion/trunk/subversion/tests/libsvn_fs_x:1413450-1532240

Modified: subversion/branches/cache-server/subversion/tests/libsvn_ra/ra-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_ra/ra-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_ra/ra-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_ra/ra-test.c Tue Oct 15 08:52:06 2013
@@ -25,17 +25,23 @@
 
 #include <apr_general.h>
 #include <apr_pools.h>
+#include <apr_file_io.h>
 
 #define SVN_DEPRECATED
 
 #include "svn_error.h"
 #include "svn_delta.h"
 #include "svn_ra.h"
+#include "svn_pools.h"
+#include "svn_cmdline.h"
+#include "svn_dirent_uri.h"
 
 #include "../svn_test.h"
 #include "../svn_test_fs.h"
 #include "../../libsvn_ra_local/ra_local.h"
 
+static const char tunnel_repos_name[] = "test-repo-tunnel";
+
 /*-------------------------------------------------------------------*/
 
 /** Helper routines. **/
@@ -58,7 +64,7 @@ make_and_open_local_repos(svn_ra_session
 
   SVN_ERR(svn_uri_get_file_url_from_dirent(&url, repos_name, pool));
 
-  SVN_ERR(svn_ra_open3(session, url, NULL, cbtable, NULL, NULL, pool));
+  SVN_ERR(svn_ra_open4(session, NULL, url, NULL, cbtable, NULL, NULL, pool));
 
   return SVN_NO_ERROR;
 }
@@ -88,6 +94,91 @@ commit_changes(svn_ra_session_t *session
   return SVN_NO_ERROR;
 }
 
+static svn_boolean_t last_tunnel_check;
+static int tunnel_open_count;
+static void *check_tunnel_baton;
+static void *open_tunnel_context;
+
+static svn_boolean_t
+check_tunnel(void *tunnel_baton, const char *tunnel_name)
+{
+  if (tunnel_baton != check_tunnel_baton)
+    abort();
+  last_tunnel_check = (0 == strcmp(tunnel_name, "test"));
+  return last_tunnel_check;
+}
+
+static svn_error_t *
+open_tunnel(apr_file_t **request, apr_file_t **response,
+            void **tunnel_context, void *tunnel_baton,
+            const char *tunnel_name, const char *user,
+            const char *hostname, int port,
+            apr_pool_t *pool)
+{
+  svn_node_kind_t kind;
+  apr_proc_t *proc;
+  apr_procattr_t *attr;
+  apr_status_t status;
+  const char *args[] = { "svnserve", "-t", "-r", ".", NULL };
+  const char *svnserve;
+
+  SVN_TEST_ASSERT(tunnel_baton == check_tunnel_baton);
+
+  SVN_ERR(svn_dirent_get_absolute(&svnserve, "../../svnserve/svnserve", pool));
+#ifdef WIN32
+  svnserve = apr_pstrcat(pool, svnserve, ".exe", NULL);
+#endif
+  SVN_ERR(svn_io_check_path(svnserve, &kind, pool));
+  if (kind != svn_node_file)
+    return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+                             "Could not find svnserve at %s",
+                             svn_dirent_local_style(svnserve, pool));
+
+  status = apr_procattr_create(&attr, pool);
+  if (status == APR_SUCCESS)
+    status = apr_procattr_io_set(attr, 1, 1, 0);
+  if (status == APR_SUCCESS)
+    status = apr_procattr_cmdtype_set(attr, APR_PROGRAM);
+  proc = apr_palloc(pool, sizeof(*proc));
+  if (status == APR_SUCCESS)
+    status = apr_proc_create(proc,
+                             svn_dirent_local_style(svnserve, pool),
+                             args, NULL, attr, pool);
+  if (status != APR_SUCCESS)
+    return svn_error_wrap_apr(status, "Could not run svnserve");
+#ifdef WIN32
+  apr_pool_note_subprocess(pool, proc, APR_KILL_NEVER);
+#else
+  apr_pool_note_subprocess(pool, proc, APR_KILL_ONLY_ONCE);
+#endif
+
+  /* APR pipe objects inherit by default.  But we don't want the
+   * tunnel agent's pipes held open by future child processes
+   * (such as other ra_svn sessions), so turn that off. */
+  apr_file_inherit_unset(proc->in);
+  apr_file_inherit_unset(proc->out);
+
+  *request = proc->in;
+  *response = proc->out;
+  open_tunnel_context = *tunnel_context = &kind;
+  ++tunnel_open_count;
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+close_tunnel(void *tunnel_context, void *tunnel_baton,
+             const char *tunnel_name, const char *user,
+             const char *hostname, int port)
+{
+  SVN_TEST_ASSERT(tunnel_context == open_tunnel_context);
+  SVN_TEST_ASSERT(tunnel_baton == check_tunnel_baton);
+  --tunnel_open_count;
+  return SVN_NO_ERROR;
+}
+
+
+
+
 /*-------------------------------------------------------------------*/
 
 /** The tests **/
@@ -151,6 +242,87 @@ location_segments_test(const svn_test_op
 }
 
 
+/* Test ra_svn tunnel callbacks. */
+
+static svn_error_t *
+check_tunnel_callback_test(const svn_test_opts_t *opts,
+                           apr_pool_t *pool)
+{
+  svn_ra_callbacks2_t *cbtable;
+  svn_ra_session_t *session;
+  svn_error_t *err;
+
+  SVN_ERR(svn_ra_create_callbacks(&cbtable, pool));
+  cbtable->check_tunnel_func = check_tunnel;
+  cbtable->open_tunnel_func = open_tunnel;
+  cbtable->close_tunnel_func = close_tunnel;
+  cbtable->tunnel_baton = check_tunnel_baton = &cbtable;
+  SVN_ERR(svn_cmdline_create_auth_baton(&cbtable->auth_baton,
+                                        TRUE  /* non_interactive */,
+                                        "jrandom", "rayjandom",
+                                        NULL,
+                                        TRUE  /* no_auth_cache */,
+                                        FALSE /* trust_server_cert */,
+                                        NULL, NULL, NULL, pool));
+
+  last_tunnel_check = TRUE;
+  open_tunnel_context = NULL;
+  err = svn_ra_open4(&session, NULL, "svn+foo://localhost/no-repo",
+                     NULL, cbtable, NULL, NULL, pool);
+  svn_error_clear(err);
+  SVN_TEST_ASSERT(err);
+  SVN_TEST_ASSERT(!last_tunnel_check);
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+tunel_callback_test(const svn_test_opts_t *opts,
+                    apr_pool_t *pool)
+{
+  apr_pool_t *connection_pool;
+  svn_repos_t *repos;
+  const char *url;
+  svn_ra_callbacks2_t *cbtable;
+  svn_ra_session_t *session;
+  svn_error_t *err;
+
+  SVN_ERR(svn_test__create_repos(&repos, tunnel_repos_name, opts, pool));
+
+  url = apr_pstrcat(pool, "svn+test://localhost/", tunnel_repos_name, NULL);
+  SVN_ERR(svn_ra_create_callbacks(&cbtable, pool));
+  cbtable->check_tunnel_func = check_tunnel;
+  cbtable->open_tunnel_func = open_tunnel;
+  cbtable->close_tunnel_func = close_tunnel;
+  cbtable->tunnel_baton = check_tunnel_baton = &cbtable;
+  SVN_ERR(svn_cmdline_create_auth_baton(&cbtable->auth_baton,
+                                        TRUE  /* non_interactive */,
+                                        "jrandom", "rayjandom",
+                                        NULL,
+                                        TRUE  /* no_auth_cache */,
+                                        FALSE /* trust_server_cert */,
+                                        NULL, NULL, NULL, pool));
+
+  last_tunnel_check = FALSE;
+  open_tunnel_context = NULL;
+  tunnel_open_count = 0;
+  connection_pool = svn_pool_create(pool);
+  err = svn_ra_open4(&session, NULL, url, NULL, cbtable, NULL, NULL,
+                     connection_pool);
+  if (err && err->apr_err == SVN_ERR_TEST_FAILED)
+    {
+      svn_handle_error2(err, stderr, FALSE, "svn_tests: ");
+      svn_error_clear(err);
+      return SVN_NO_ERROR;
+    }
+  SVN_ERR(err);
+  SVN_TEST_ASSERT(last_tunnel_check);
+  SVN_TEST_ASSERT(tunnel_open_count > 0);
+  svn_pool_destroy(connection_pool);
+  SVN_TEST_ASSERT(tunnel_open_count == 0);
+  return SVN_NO_ERROR;
+}
+
+
 
 /* The test table.  */
 struct svn_test_descriptor_t test_funcs[] =
@@ -158,5 +330,9 @@ struct svn_test_descriptor_t test_funcs[
     SVN_TEST_NULL,
     SVN_TEST_OPTS_PASS(location_segments_test,
                        "test svn_ra_get_location_segments"),
+    SVN_TEST_OPTS_PASS(check_tunnel_callback_test,
+                       "test ra_svn tunnel callback check"),
+    SVN_TEST_OPTS_PASS(tunel_callback_test,
+                       "test ra_svn tunnel creation callbacks"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/cache-server/subversion/tests/libsvn_repos/repos-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_repos/repos-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_repos/repos-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_repos/repos-test.c Tue Oct 15 08:52:06 2013
@@ -26,6 +26,7 @@
 
 #include "../svn_test.h"
 
+#include "svn_private_config.h"
 #include "svn_pools.h"
 #include "svn_error.h"
 #include "svn_fs.h"
@@ -3164,7 +3165,7 @@ test_delete_repos(const svn_test_opts_t 
   return SVN_NO_ERROR;
 }
 
-/* Related to issue 4340, "fs layer should reject filenames with trailing \n" */
+/* Related to issue 4340, "filenames containing \n corrupt FSFS repositories" */
 static svn_error_t *
 filename_with_control_chars(const svn_test_opts_t *opts,
                             apr_pool_t *pool)
@@ -3270,21 +3271,26 @@ test_repos_info(const svn_test_opts_t *o
   svn_version_t v1_0_0 = {1, 0, 0, ""};
   svn_version_t v1_4_0 = {1, 4, 0, ""};
   int repos_format;
+  svn_boolean_t is_fsx = strcmp(opts->fs_type, "fsx") == 0;
 
   opts2 = *opts;
 
-  opts2.server_minor_version = 3;
-  SVN_ERR(svn_test__create_repos(&repos, "test-repo-info-3",
-                                 &opts2, pool));
-  SVN_ERR(svn_repos_capabilities(&capabilities, repos, pool, pool));
-  SVN_TEST_ASSERT(apr_hash_count(capabilities) == 0);
-  SVN_ERR(svn_repos_info_format(&repos_format, &supports_version, repos,
-                                pool, pool));
-  SVN_TEST_ASSERT(repos_format == 3);
-  SVN_TEST_ASSERT(svn_ver_equal(supports_version, &v1_0_0));
+  /* for repo types that have been around before 1.4 */
+  if (!is_fsx)
+    {
+      opts2.server_minor_version = 3;
+      SVN_ERR(svn_test__create_repos(&repos, "test-repo-info-3",
+                                     &opts2, pool));
+      SVN_ERR(svn_repos_capabilities(&capabilities, repos, pool, pool));
+      SVN_TEST_ASSERT(apr_hash_count(capabilities) == 0);
+      SVN_ERR(svn_repos_info_format(&repos_format, &supports_version, repos,
+                                    pool, pool));
+      SVN_TEST_ASSERT(repos_format == 3);
+      SVN_TEST_ASSERT(svn_ver_equal(supports_version, &v1_0_0));
+    }
 
-  opts2.server_minor_version = 8;
-  SVN_ERR(svn_test__create_repos(&repos, "test-repo-info-8",
+  opts2.server_minor_version = 9;
+  SVN_ERR(svn_test__create_repos(&repos, "test-repo-info-9",
                                  &opts2, pool));
   SVN_ERR(svn_repos_capabilities(&capabilities, repos, pool, pool));
   SVN_TEST_ASSERT(apr_hash_count(capabilities) == 1);

Propchange: subversion/branches/cache-server/subversion/tests/libsvn_subr/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Oct 15 08:52:06 2013
@@ -42,3 +42,6 @@ named_atomic-proc-test
 io-test
 io-test-temp
 auth-clear
+prefix-string-test
+priority-queue-test
+packed-data-test

Modified: subversion/branches/cache-server/subversion/tests/libsvn_subr/auth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_subr/auth-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_subr/auth-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_subr/auth-test.c Tue Oct 15 08:52:06 2013
@@ -319,13 +319,7 @@ struct svn_test_descriptor_t test_funcs[
     SVN_TEST_NULL,
     SVN_TEST_PASS2(test_platform_specific_auth_providers,
                    "test retrieving platform-specific auth providers"),
-#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
     SVN_TEST_PASS2(test_auth_clear,
                    "test svn_auth_clear()"),
-#else
-    SVN_TEST_WIMP(test_auth_clear,
-                  "test svn_auth_clear()",
-                  "Needs testing with SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE"),
-#endif
     SVN_TEST_NULL
   };

Modified: subversion/branches/cache-server/subversion/tests/libsvn_subr/cache-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_subr/cache-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_subr/cache-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_subr/cache-test.c Tue Oct 15 08:52:06 2013
@@ -193,6 +193,7 @@ test_membuffer_cache_basic(apr_pool_t *p
                                             deserialize_revnum,
                                             APR_HASH_KEY_STRING,
                                             "cache:",
+                                            SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY,
                                             FALSE,
                                             pool));
 

Modified: subversion/branches/cache-server/subversion/tests/libsvn_subr/config-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_subr/config-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_subr/config-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_subr/config-test.c Tue Oct 15 08:52:06 2013
@@ -336,6 +336,22 @@ test_stream_interface(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_ignore_bom(apr_pool_t *pool)
+{
+  svn_config_t *cfg;
+  svn_string_t *cfg_string = svn_string_create("\xEF\xBB\xBF[s1]\nfoo=bar\n",
+                                               pool);
+  svn_stream_t *stream = svn_stream_from_string(cfg_string, pool);
+
+  SVN_ERR(svn_config_parse(&cfg, stream, TRUE, TRUE, pool));
+
+  if (! svn_config_has_section(cfg, "s1"))
+    return fail(pool, "failed to find section s1");
+
+  return SVN_NO_ERROR;
+}
+
 /*
    ====================================================================
    If you add a new test to this file, update this array.
@@ -359,5 +375,6 @@ struct svn_test_descriptor_t test_funcs[
                    "test case-sensitive option name lookup"),
     SVN_TEST_PASS2(test_stream_interface,
                    "test svn_config_parse"),
+    SVN_TEST_PASS2(test_ignore_bom, "test parsing config file with BOM"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/cache-server/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_subr/dirent_uri-test.c Tue Oct 15 08:52:06 2013
@@ -911,6 +911,9 @@ static const testcase_canonicalize_t uri
     { "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
     { "file:///c:/",           "file:///c:" },
 #endif /* SVN_USE_DOS_PATHS */
+    /* Hostnames that look like non-canonical paths */
+    { "file://./foo",             "file://./foo" },
+    { "http://./foo",             "http://./foo" },
   /* svn_uri_is_canonical() was a private function in the 1.6 API, and
      has since taken a MAJOR change of direction, namely that only
      absolute URLs are considered canonical uris now. */

Modified: subversion/branches/cache-server/subversion/tests/libsvn_subr/error-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_subr/error-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_subr/error-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_subr/error-test.c Tue Oct 15 08:52:06 2013
@@ -207,6 +207,7 @@ test_error_symbolic_name(apr_pool_t *poo
     { SVN_ERR_BAD_CATEGORY_START, "SVN_ERR_BAD_CONTAINING_POOL" },
 #ifdef SVN_DEBUG
     { ENOENT, "ENOENT" },
+    { APR_ENOPOOL, "APR_ENOPOOL" },
 #endif
     /* Test non-errors. */
     { -1, NULL },

Modified: subversion/branches/cache-server/subversion/tests/libsvn_subr/hashdump-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_subr/hashdump-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_subr/hashdump-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_subr/hashdump-test.c Tue Oct 15 08:52:06 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"

Modified: subversion/branches/cache-server/subversion/tests/libsvn_subr/io-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_subr/io-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_subr/io-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_subr/io-test.c Tue Oct 15 08:52:06 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"
@@ -481,6 +483,161 @@ test_three_file_content_comparison(apr_p
   return err;
 }
 
+static svn_error_t *
+read_length_line_shouldnt_loop(apr_pool_t *pool)
+{
+  const char *tmp_dir;
+  const char *tmp_file;
+  char buffer[4];
+  apr_size_t buffer_limit = sizeof(buffer);
+  apr_file_t *f;
+
+  SVN_ERR(svn_dirent_get_absolute(&tmp_dir, "read_length_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);
+
+  SVN_ERR(svn_io_write_unique(&tmp_file, tmp_dir, "1234\r\n", 6,
+                              svn_io_file_del_on_pool_cleanup, pool));
+
+  SVN_ERR(svn_io_file_open(&f, tmp_file, APR_READ, APR_OS_DEFAULT, pool));
+
+  SVN_TEST_ASSERT_ERROR(svn_io_read_length_line(f, buffer, &buffer_limit,
+                                                pool), SVN_ERR_MALFORMED_FILE);
+  SVN_TEST_ASSERT(buffer_limit == 4);
+
+  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.  */
@@ -496,5 +653,9 @@ struct svn_test_descriptor_t test_funcs[
                    "three file size comparison"),
     SVN_TEST_PASS2(test_three_file_content_comparison,
                    "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/cache-server/subversion/tests/libsvn_subr/mergeinfo-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_subr/mergeinfo-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_subr/mergeinfo-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_subr/mergeinfo-test.c Tue Oct 15 08:52:06 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"

Modified: subversion/branches/cache-server/subversion/tests/libsvn_subr/revision-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_subr/revision-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_subr/revision-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_subr/revision-test.c Tue Oct 15 08:52:06 2013
@@ -34,6 +34,12 @@ test_revnum_parse(apr_pool_t *pool)
     "",
     "abc",
     "-456",
+    "2147483648",
+    "4294967295",
+    "4300000000",
+    "00000000001",
+    "21474836470",
+    "999999999999999999999999",
     NULL
   };
 
@@ -41,6 +47,8 @@ test_revnum_parse(apr_pool_t *pool)
     "0",
     "12345",
     "12345ABC",
+    "0000000001",
+    "2147483647x",
     NULL
   };
 

Modified: subversion/branches/cache-server/subversion/tests/libsvn_subr/spillbuf-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_subr/spillbuf-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_subr/spillbuf-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_subr/spillbuf-test.c Tue Oct 15 08:52:06 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,103 @@ 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.  */
 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/cache-server/subversion/tests/libsvn_subr/stream-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/tests/libsvn_subr/stream-test.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/tests/libsvn_subr/stream-test.c (original)
+++ subversion/branches/cache-server/subversion/tests/libsvn_subr/stream-test.c Tue Oct 15 08:52:06 2013
@@ -727,6 +727,50 @@ 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.  */
 
 struct svn_test_descriptor_t test_funcs[] =
@@ -752,5 +796,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
   };