subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1329808 - /subversion/trunk/subversion/tests/svn_test.h
Date Tue, 24 Apr 2012 15:50:45 GMT
Author: julianfoad
Date: Tue Apr 24 15:50:45 2012
New Revision: 1329808

URL: http://svn.apache.org/viewvc?rev=1329808&view=rev
Log:
* subversion/tests/svn_test.h
  (SVN_TEST_STRING_ASSERT): Allow either of the strings to be NULL.

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=1329808&r1=1329807&r2=1329808&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/svn_test.h (original)
+++ subversion/trunk/subversion/tests/svn_test.h Tue Apr 24 15:50:45 2012
@@ -74,6 +74,7 @@ extern "C" {
   } while (0)
 
 /** Handy macro for testing string equality.
+ * EXPR and/or EXPECTED_EXPR may be NULL.
  */
 #define SVN_TEST_STRING_ASSERT(expr, expected_expr)                 \
   do {                                                              \
@@ -82,8 +83,8 @@ extern "C" {
                                                                     \
     if (tst_str2 == NULL && tst_str1 == NULL)                       \
       break;                                                        \
-    if (   (tst_str2 != NULL && tst_str1 == NULL)                   \
-        || (strcmp(tst_str2, tst_str1) != 0)  )                     \
+    if ((tst_str1 == NULL) || (tst_str2 == NULL)                    \
+        || (strcmp(tst_str2, tst_str1) != 0))                       \
       return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,           \
           "Strings not equal\n  Expected: '%s'\n  Found:    '%s'"   \
           "\n  at %s:%d",                                           \



Mime
View raw message