> -----Original Message-----
> From: stsp_at_apache.org [mailto:stsp_at_apache.org]
> Sent: woensdag 27 maart 2013 12:55
> To: commits_at_subversion.apache.org
> Subject: svn commit: r1461542 -
> /subversion/trunk/subversion/tests/libsvn_repos/repos-test.c
>
> Author: stsp
> Date: Wed Mar 27 11:55:10 2013
> New Revision: 1461542
>
> URL: http://svn.apache.org/r1461542
> Log:
> Follow-up to r1461535:
>
> * subversion/tests/libsvn_repos/repos-test.c
> (filename_trailing_newline): Tweak this test to verify behaviour of
> the repos layer, not the FS layer. Current consensus seems to be that
> the FS API should allow such names, and the repos layer should reject
> them. So expect a commit of the transaction via the repos API to fail,
> rather than expecting the FS layer to reject the creation of filenames
> with trailing newlines in transactions.
>
> Modified:
> subversion/trunk/subversion/tests/libsvn_repos/repos-test.c
>
> Modified: subversion/trunk/subversion/tests/libsvn_repos/repos-test.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_re
> pos/repos-test.c?rev=1461542&r1=1461541&r2=1461542&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/tests/libsvn_repos/repos-test.c (original)
> +++ subversion/trunk/subversion/tests/libsvn_repos/repos-test.c Wed Mar
> 27 11:55:10 2013
> @@ -3192,15 +3192,26 @@ filename_trailing_newline(const svn_test
> svn_pool_clear(subpool);
>
> /* Attempt to copy /foo to "/bar\n". This should fail. */
> + youngest_rev = 1;
> SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, subpool));
> 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);
> + SVN_ERR(svn_fs_copy(root, "/foo", txn_root, "/bar\n", subpool));
> + err = svn_repos_fs_commit_txn(NULL, repos, &youngest_rev, txn,
> subpool);
> SVN_TEST_ASSERT(err != SVN_NO_ERROR);
> + svn_error_clear(err);
> + svn_pool_clear(subpool);
>
> - /* Attempt to create a file /foo/baz\n. This should fail. */
> - err = svn_fs_make_file(txn_root, "/foo/baz\n", subpool);
> + /* Attempt to commit a file /foo/baz\n. This should fail. */
> + youngest_rev = 1;
> + SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, subpool));
> + SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
> + SVN_ERR(svn_fs_revision_root(&root, fs, youngest_rev, subpool));
> + SVN_ERR(svn_fs_make_file(txn_root, "/foo/baz\n", subpool));
> + err = svn_repos_fs_commit_txn(NULL, repos, &youngest_rev, txn,
> subpool);
> SVN_TEST_ASSERT(err != SVN_NO_ERROR);
> + svn_error_clear(err);
> + svn_pool_clear(subpool);
I think there is some SVN_TEST_ macro that tests for a specific error code and then clears the error for you.
That would be a more stable test than just assuming any error is ok.
Bert
Received on 2013-03-27 13:17:41 CET