subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1679909 - /subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
Date Sun, 17 May 2015 23:22:03 GMT
Author: danielsh
Date: Sun May 17 23:22:03 2015
New Revision: 1679909

URL: http://svn.apache.org/r1679909
Log:
Follow-up to r1679169: Further extend the unit test.

* subversion/tests/libsvn_fs/fs-test.c
  (noop_freeze_func): Transform into..
  (freeze_func): .. this.
  (freeze_and_commit): Incorporate a failed freeze into the test scenario.

Modified:
    subversion/trunk/subversion/tests/libsvn_fs/fs-test.c

Modified: subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs/fs-test.c?rev=1679909&r1=1679908&r2=1679909&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs/fs-test.c Sun May 17 23:22:03 2015
@@ -6891,11 +6891,12 @@ test_internal_txn_props(const svn_test_o
   return SVN_NO_ERROR;
 }
 
+/* A freeze function that expects an 'svn_error_t *' baton, and returns it. */
 /* This function implements svn_fs_freeze_func_t. */
 static svn_error_t *
-noop_freeze_func(void *baton, apr_pool_t *pool)
+freeze_func(void *baton, apr_pool_t *pool)
 {
-  return SVN_NO_ERROR;
+  return baton;
 }
 
 static svn_error_t *
@@ -6926,10 +6927,14 @@ freeze_and_commit(const svn_test_opts_t
   SVN_ERR(test_commit_txn(&new_rev, txn, NULL, subpool));
 
   /* Freeze and unfreeze. */
-  SVN_ERR(svn_fs_freeze(fs, noop_freeze_func, NULL, pool));
+  SVN_ERR(svn_fs_freeze(fs, freeze_func, SVN_NO_ERROR, pool));
 
-  /* And the same once again, for good measure. */
-  SVN_ERR(svn_fs_freeze(fs, noop_freeze_func, NULL, pool));
+  /* Freeze again, but have freeze_func fail. */
+    {
+      svn_error_t *err = svn_error_create(APR_EGENERAL, NULL, NULL);
+      SVN_TEST_ASSERT_ERROR(svn_fs_freeze(fs, freeze_func, err, pool),
+                            err->apr_err);
+    }
 
   /* Make some commit using same FS instance. */
   SVN_ERR(svn_fs_begin_txn(&txn, fs, new_rev, pool));



Mime
View raw message