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

Re: svn commit: r1330135 - /subversion/trunk/subversion/tests/svn_test.h

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 25 Apr 2012 11:20:18 +0100 (BST)

----- Original Message -----
> From: Greg Stein <gstein_at_gmail.com>
> To: dev_at_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,  <julianfoad_at_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
Received on 2012-04-25 12:20:54 CEST

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.