[prev in list] [next in list] [prev in thread] [next in thread]
List: subversion-commits
Subject: svn commit: r1888590 - /subversion/trunk/subversion/tests/svn_test.h
From: stefan2 () apache ! org
Date: 2021-04-10 15:49:45
Message-ID: 20210410154945.594E217A411 () svn01-us-east ! apache ! org
[Download RAW message or body]
Author: stefan2
Date: Sat Apr 10 15:49:44 2021
New Revision: 1888590
URL: http://svn.apache.org/viewvc?rev=1888590&view=rev
Log:
Fix GCC "warning: ‘%s' directive argument is null" in tests.
* subversion/tests/svn_test.h
(SVN_TEST_STRING_ASSERT): Don't pass NULL as strings into formatters.
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=1888590&r1=1888589&r2=1888590&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/svn_test.h (original)
+++ subversion/trunk/subversion/tests/svn_test.h Sat Apr 10 15:49:44 2021
@@ -124,8 +124,17 @@ extern "C" {
\
if (tst_str2 == NULL && tst_str1 == NULL) \
break; \
- if ((tst_str1 == NULL) || (tst_str2 == NULL) \
- || (strcmp(tst_str2, tst_str1) != 0)) \
+ if (tst_str1 == NULL) \
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL, \
+ "Strings not equal\n Expected: '%s'\n Found: NULL" \
+ "\n at %s:%d", \
+ tst_str2, __FILE__, __LINE__); \
+ if (tst_str2 == NULL) \
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL, \
+ "Strings not equal\n Expected: NULL\n Found: '%s'" \
+ "\n at %s:%d", \
+ tst_str1, __FILE__, __LINE__); \
+ if (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", \
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic