You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@gmail.com> on 2012/04/25 10:37:27 UTC
Re: svn commit: r1330135 - /subversion/trunk/subversion/tests/svn_test.h
On Wed, Apr 25, 2012 at 03:29, <ju...@apache.org> wrote:
> Author: julianfoad
> Date: Wed Apr 25 07:29:07 2012
> New Revision: 1330135
>
> URL: http://svn.apache.org/viewvc?rev=1330135&view=rev
> Log:
> * subversion/tests/svn_test.h
> (SVN_TEST_STRING_ASSERT): Clarify the doc string, following r1329808.
>
> Modified:
> subversion/trunk/subversion/tests/svn_test.h
>
> Modified: subversion/trunk/subversion/tests/svn_test.h
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/svn_test.h?rev=1330135&r1=1330134&r2=1330135&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/svn_test.h (original)
> +++ subversion/trunk/subversion/tests/svn_test.h Wed Apr 25 07:29:07 2012
> @@ -74,7 +74,9 @@ extern "C" {
> } while (0)
>
> /** Handy macro for testing string equality.
> - * EXPR and/or EXPECTED_EXPR may be NULL.
> + *
> + * EXPR and/or EXPECTED_EXPR may be NULL which compares equal to NULL and
> + * not equal to any non-NULL string.
Honestly, I don't care how it compares to anything. What does it do to
the *TEST*?
Does it raise a failure? Is it successful?
The docstring is opaque. I need to look at the macro to determine what
it will do to my test case.
Cheers,
-g
Re: svn commit: r1330135 -
/subversion/trunk/subversion/tests/svn_test.h
Posted by Daniel Shahaf <da...@elego.de>.
Greg Stein wrote on Wed, Apr 25, 2012 at 04:37:27 -0400:
> On Wed, Apr 25, 2012 at 03:29, <ju...@apache.org> wrote:
> > Author: julianfoad
> > Date: Wed Apr 25 07:29:07 2012
> > New Revision: 1330135
> >
> > URL: http://svn.apache.org/viewvc?rev=1330135&view=rev
> > Log:
> > * subversion/tests/svn_test.h
> > (SVN_TEST_STRING_ASSERT): Clarify the doc string, following r1329808.
> >
> > Modified:
> > subversion/trunk/subversion/tests/svn_test.h
> >
> > Modified: subversion/trunk/subversion/tests/svn_test.h
> > URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/svn_test.h?rev=1330135&r1=1330134&r2=1330135&view=diff
> > ==============================================================================
> > --- subversion/trunk/subversion/tests/svn_test.h (original)
> > +++ subversion/trunk/subversion/tests/svn_test.h Wed Apr 25 07:29:07 2012
> > @@ -74,7 +74,9 @@ extern "C" {
> > } while (0)
> >
> > /** Handy macro for testing string equality.
> > - * EXPR and/or EXPECTED_EXPR may be NULL.
> > + *
> > + * EXPR and/or EXPECTED_EXPR may be NULL which compares equal to NULL and
> > + * not equal to any non-NULL string.
>
> Honestly, I don't care how it compares to anything. What does it do to
> the *TEST*?
>
> Does it raise a failure? Is it successful?
>
The test raises when the comparison returns "not equal". I find it
clear but won't object to a more explicit docstring.
> The docstring is opaque. I need to look at the macro to determine what
> it will do to my test case.
>
> Cheers,
> -g
Re: svn commit: r1330135 - /subversion/trunk/subversion/tests/svn_test.h
Posted by Julian Foad <ju...@btopenworld.com>.
----- Original Message -----
> From: Greg Stein <gs...@gmail.com>
> To: dev@subversion.apache.org
> Cc:
> Sent: Wednesday, 25 April 2012, 9:37
> Subject: Re: svn commit: r1330135 - /subversion/trunk/subversion/tests/svn_test.h
>
> On Wed, Apr 25, 2012 at 03:29, <ju...@apache.org> wrote:
>> Author: julianfoad
>> Date: Wed Apr 25 07:29:07 2012
>> New Revision: 1330135
>>
>> URL: http://svn.apache.org/viewvc?rev=1330135&view=rev
>> Log:
>> * subversion/tests/svn_test.h
>> (SVN_TEST_STRING_ASSERT): Clarify the doc string, following r1329808.
>>
>> Modified:
>> subversion/trunk/subversion/tests/svn_test.h
>>
>> Modified: subversion/trunk/subversion/tests/svn_test.h
>> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/svn_test.h?rev=1330135&r1=1330134&r2=1330135&view=diff
>>
> ==============================================================================
>> --- subversion/trunk/subversion/tests/svn_test.h (original)
>> +++ subversion/trunk/subversion/tests/svn_test.h Wed Apr 25 07:29:07 2012
>> @@ -74,7 +74,9 @@ extern "C" {
>> } while (0)
>>
>> /** Handy macro for testing string equality.
>> - * EXPR and/or EXPECTED_EXPR may be NULL.
>> + *
>> + * EXPR and/or EXPECTED_EXPR may be NULL which compares equal to NULL and
>> + * not equal to any non-NULL string.
>
> Honestly, I don't care how it compares to anything. What does it do to
> the *TEST*?
It's documented as testing two strings for equality. Sure, it doesn't explicitly say what it does if they are or aren't equal, but all I did was extend the semantics of what is a valid "string" input. That's why how NULLs compare is the relevant additional fact.
> Does it raise a failure? Is it successful?
I'm happy to write a better doc string.
* If EXPR and EXPECTED_EXPR are pointers to equal null-terminated
* strings, or are noth NULL, do nothing. Otherwise, execute a
* 'return' statement returning a pointer to an svn_error_t object
* that describes the mis-match.
Like that?
> The docstring is opaque. I need to look at the macro to determine what
> it will do to my test case.
But you *like* reading the code :-)
- Julian