You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by Daniel Shahaf <d....@daniel.shahaf.name> on 2010/12/27 20:32:56 UTC

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

blair@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)
> 
> 

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

Posted by Blair Zajac <bl...@orcaware.com>.
On 12/27/10 11:39 AM, Blair Zajac wrote:
> On 12/27/10 11:32 AM, Daniel Shahaf wrote:
>> blair@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)
>
> That's right, thanks. And we don't have SVN_ERR__TRACED either, so we couldn't
> manually build one. I'll update the code.

Fixed in r1053165.

Blair

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

Posted by Blair Zajac <bl...@orcaware.com>.
On 12/27/10 11:32 AM, Daniel Shahaf wrote:
> blair@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)

That's right, thanks.  And we don't have SVN_ERR__TRACED either, so we couldn't 
manually build one.  I'll update the code.

Blair