[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1053130 - /subversion/trunk/subversion/tests/libsvn_subr/error-test.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Mon, 27 Dec 2010 21:32:56 +0200

blair_at_apache.org wrote on Mon, Dec 27, 2010 at 18:36:46 -0000:
> Author: blair
> Date: Mon Dec 27 18:36:46 2010
> New Revision: 1053130
>
> URL: http://svn.apache.org/viewvc?rev=1053130&view=rev
> Log:
> Have the svn_error_purge_tracing() unit test makes some real tracing
> links so that svn_error_purge_tracing() can be properly tested, the
> error links in the current code are not tracing links.
>
> * subversion/tests/libsvn_subr/error-test.c
> (test_error_purge_tracing):
> Use svn_error_return() to create tracing errors.
>
> Modified:
> subversion/trunk/subversion/tests/libsvn_subr/error-test.c
>
> Modified: subversion/trunk/subversion/tests/libsvn_subr/error-test.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/error-test.c?rev=1053130&r1=1053129&r2=1053130&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/libsvn_subr/error-test.c (original)
> +++ subversion/trunk/subversion/tests/libsvn_subr/error-test.c Mon Dec 27 18:36:46 2010
> @@ -90,12 +90,18 @@ test_error_purge_tracing(apr_pool_t *poo
> "SVN_NO_ERROR after being passed a "
> "SVN_NO_ERROR.");
>
> - err = svn_error_quick_wrap(svn_error_create(SVN_ERR_BASE, NULL,
> - "root error"),
> - "wrapped");
> - err = svn_error_quick_wrap(svn_error_create(SVN_ERR_BASE, err,
> - "other error"),
> - "re-wrapped");
> + err = svn_error_return(svn_error_create(SVN_ERR_BASE, NULL, "root error"));
> + if (! svn_error__is_tracing_link(err))
> + {

Good catch that the preexisting code was buggy, but isn't this test
going to fail in non-maintainer mode? (because when SVN_ERR__TRACING
isn't defined, svn_error_return() won't add the tracing wrapper link)

> + return svn_error_create(SVN_ERR_TEST_FAILED, err,
> + "The top error is not a tracing link:");
> + }
> + err = svn_error_return(svn_error_create(SVN_ERR_BASE, err, "other error"));
> + if (! svn_error__is_tracing_link(err))
> + {
> + return svn_error_create(SVN_ERR_TEST_FAILED, err,
> + "The top error is not a tracing link:");
> + }
>
> err2 = svn_error_purge_tracing(err);
> for (child = err2; child; child = child->child)
>
>
Received on 2010-12-27 20:37:52 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.