You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2021/04/10 15:49:45 UTC
svn commit: r1888590 - /subversion/trunk/subversion/tests/svn_test.h
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", \