subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1633966 - /subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
Date Thu, 23 Oct 2014 22:07:57 GMT
Author: stefan2
Date: Thu Oct 23 22:07:57 2014
New Revision: 1633966

URL: http://svn.apache.org/r1633966
Log:
Make the "reopen txn" test slightly more meaningful and use it to cover
svn_fs_txn_root_name() as well.

* subversion/tests/libsvn_fs/fs-test.c
  (reopen_trivial_transaction): Create 3 txns such that SVN has at least
                                a chance to return the wrong one. Verify
                                that it picked the correct one.

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=1633966&r1=1633965&r2=1633966&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs/fs-test.c Thu Oct 23 22:07:57 2014
@@ -208,24 +208,35 @@ reopen_trivial_transaction(const svn_tes
 {
   svn_fs_t *fs;
   svn_fs_txn_t *txn;
+  svn_fs_root_t *root;
   const char *txn_name;
   apr_pool_t *subpool = svn_pool_create(pool);
 
   SVN_ERR(svn_test__create_fs(&fs, "test-repo-reopen-trivial-txn",
                               opts, pool));
 
-  /* Begin a new transaction that is based on revision 0.  */
+  /* Create a first transaction - we don't want that one to reopen. */
+  SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, subpool));
+
+  /* Begin a second transaction that is based on revision 0.  */
   SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, subpool));
 
   /* Don't use the subpool, txn_name must persist beyond the current txn */
   SVN_ERR(svn_fs_txn_name(&txn_name, txn, pool));
 
+  /* Create a third transaction - we don't want that one to reopen. */
+  SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, subpool));
+
   /* Close the transaction. */
   svn_pool_clear(subpool);
 
   /* Reopen the transaction by name */
   SVN_ERR(svn_fs_open_txn(&txn, fs, txn_name, subpool));
 
+  /* Does it have the same name? */
+  SVN_ERR(svn_fs_txn_root(&root, txn, subpool));
+  SVN_TEST_STRING_ASSERT(svn_fs_txn_root_name(root, subpool), txn_name);
+
   /* Close the transaction ... again. */
   svn_pool_destroy(subpool);
 



Mime
View raw message