You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/11/26 09:27:41 UTC
svn commit: r1716579 - /subversion/trunk/subversion/tests/libsvn_ra/ra-test.c
Author: rhuijben
Date: Thu Nov 26 08:27:41 2015
New Revision: 1716579
URL: http://svn.apache.org/viewvc?rev=1716579&view=rev
Log:
Following up on r1716548, add another regression test. Asserting current
behavior.
* subversion/tests/libsvn_ra/ra-test.c
(commit_empty_last_change): New test.
(test_funcs): Add commit_empty_last_change.
Modified:
subversion/trunk/subversion/tests/libsvn_ra/ra-test.c
Modified: subversion/trunk/subversion/tests/libsvn_ra/ra-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_ra/ra-test.c?rev=1716579&r1=1716578&r2=1716579&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_ra/ra-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_ra/ra-test.c Thu Nov 26 08:27:41 2015
@@ -1572,7 +1572,51 @@ tunnel_run_checkout(const svn_test_opts_
return SVN_NO_ERROR;
}
-
+static svn_error_t *
+commit_empty_last_change(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_ra_session_t *session;
+ apr_hash_t *revprop_table = apr_hash_make(pool);
+ svn_delta_editor_t *editor;
+ void *edit_baton;
+ const char *repos_root_url;
+ void *root_baton;
+ apr_pool_t *tmp_pool = svn_pool_create(pool);
+ svn_dirent_t *dirent;
+
+ SVN_ERR(make_and_open_repos(&session,
+ "commit_empty_last_change", opts,
+ pool));
+
+ SVN_ERR(commit_changes(session, tmp_pool));
+ svn_pool_clear(tmp_pool);
+
+ SVN_ERR(svn_ra_get_repos_root2(session, &repos_root_url, pool));
+ SVN_ERR(svn_ra_get_commit_editor3(session, &editor, &edit_baton,
+ revprop_table,
+ NULL, NULL, NULL, TRUE, tmp_pool));
+
+ SVN_ERR(editor->open_root(edit_baton, 1, tmp_pool, &root_baton));
+ SVN_ERR(editor->close_directory(root_baton, tmp_pool));
+ SVN_ERR(editor->close_edit(edit_baton, tmp_pool));
+
+ SVN_ERR(svn_ra_stat(session, "", 2, &dirent, tmp_pool));
+
+ SVN_TEST_ASSERT(dirent != NULL);
+ SVN_TEST_STRING_ASSERT(dirent->last_author, "jrandom");
+
+ /* BDB only updates last_changed on the repos_root when there is an
+ actual change. Our other filesystems handle this differently */
+ if (!opts->fs_type || !strcasecmp(opts->fs_type, "BDB"))
+ SVN_TEST_ASSERT(dirent->created_rev == 1);
+ else
+ SVN_TEST_ASSERT(dirent->created_rev == 2);
+
+ return SVN_NO_ERROR;
+}
+
+
/* The test table. */
static int max_threads = 4;
@@ -1604,6 +1648,8 @@ static struct svn_test_descriptor_t test
"check list has_props performance"),
SVN_TEST_OPTS_PASS(tunnel_run_checkout,
"verify checkout over a tunnel"),
+ SVN_TEST_OPTS_PASS(commit_empty_last_change,
+ "check how last change applies to empty commit"),
SVN_TEST_NULL
};