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 2014/09/22 13:11:01 UTC

svn commit: r1626731 - in /subversion/branches/1.8.x-r1619774: ./ subversion/tests/libsvn_fs_fs/fs-pack-test.c

Author: stefan2
Date: Mon Sep 22 11:11:00 2014
New Revision: 1626731

URL: http://svn.apache.org/r1626731
Log:
Merge r1619105,1619118,1619153,1619802 from /trunk resolving
the file rename conflict. This contains the new test case.

Modified:
    subversion/branches/1.8.x-r1619774/   (props changed)
    subversion/branches/1.8.x-r1619774/subversion/tests/libsvn_fs_fs/fs-pack-test.c

Propchange: subversion/branches/1.8.x-r1619774/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1619105,1619118,1619153,1619802

Modified: subversion/branches/1.8.x-r1619774/subversion/tests/libsvn_fs_fs/fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1619774/subversion/tests/libsvn_fs_fs/fs-pack-test.c?rev=1626731&r1=1626730&r2=1626731&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1619774/subversion/tests/libsvn_fs_fs/fs-pack-test.c (original)
+++ subversion/branches/1.8.x-r1619774/subversion/tests/libsvn_fs_fs/fs-pack-test.c Mon Sep 22 11:11:00 2014
@@ -38,6 +38,16 @@
 
 /*** Helper Functions ***/
 
+static void
+ignore_fs_warnings(void *baton, svn_error_t *err)
+{
+#ifdef SVN_DEBUG
+  SVN_DBG(("Ignoring FS warning %s\n",
+           svn_error_symbolic_name(err ? err->apr_err : 0)));
+#endif
+  return;
+}
+
 /* Write the format number and maximum number of files per directory
    to a new format file in PATH, overwriting a previously existing
    file.  Use POOL for temporary allocation.
@@ -857,6 +867,56 @@ get_set_multiple_huge_revprops_packed_fs
 #undef SHARD_SIZE
 
 /* ------------------------------------------------------------------------ */
+
+#define REPO_NAME "revprop_caching_on_off"
+static svn_error_t *
+revprop_caching_on_off(const svn_test_opts_t *opts,
+                       apr_pool_t *pool)
+{
+  svn_fs_t *fs1;
+  svn_fs_t *fs2;
+  apr_hash_t *fs_config;
+  svn_string_t *value;
+  const svn_string_t *another_value_for_avoiding_warnings_from_a_broken_api;
+  const svn_string_t *new_value = svn_string_create("new", pool);
+
+  if (strcmp(opts->fs_type, "fsfs") != 0)
+    return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL, NULL);
+
+  /* Open two filesystem objects, enable revision property caching
+   * in one of them. */
+  SVN_ERR(svn_test__create_fs(&fs1, REPO_NAME, opts, pool));
+
+  fs_config = apr_hash_make(pool);
+  svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_REVPROPS, "1");
+
+  SVN_ERR(svn_fs_open2(&fs2, svn_fs_path(fs1, pool), fs_config, pool, pool));
+
+  /* With inefficient named atomics, the filesystem will output a warning
+     and disable the revprop caching, but we still would like to test
+     these cases.  Ignore the warning(s). */
+  svn_fs_set_warning_func(fs2, ignore_fs_warnings, NULL);
+
+  SVN_ERR(svn_fs_revision_prop(&value, fs2, 0, "svn:date", pool));
+  another_value_for_avoiding_warnings_from_a_broken_api = value;
+  SVN_ERR(svn_fs_change_rev_prop2(
+              fs1, 0, "svn:date",
+              &another_value_for_avoiding_warnings_from_a_broken_api,
+              new_value, pool));
+
+  /* Expect the change to be visible through both objects.*/
+  SVN_ERR(svn_fs_revision_prop(&value, fs1, 0, "svn:date", pool));
+  SVN_TEST_STRING_ASSERT(value->data, "new");
+
+  SVN_ERR(svn_fs_revision_prop(&value, fs2, 0, "svn:date", pool));
+  SVN_TEST_STRING_ASSERT(value->data, "new");
+
+  return SVN_NO_ERROR;
+}
+
+#undef REPO_NAME
+
+/* ------------------------------------------------------------------------ */
 
 /* The test table.  */
 
@@ -883,5 +943,7 @@ struct svn_test_descriptor_t test_funcs[
                        "test file hint at shard boundary"),
     SVN_TEST_OPTS_PASS(get_set_multiple_huge_revprops_packed_fs,
                        "set multiple huge revprops in packed FSFS"),
+    SVN_TEST_OPTS_PASS(revprop_caching_on_off,
+                       "change revprops with enabled and disabled caching"),
     SVN_TEST_NULL
   };