]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-test: Rename s1, s2 to _temp_s1, _temp_s2 in test_assert_strcmp_idx
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 10 Jul 2020 08:00:14 +0000 (11:00 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 10 Jul 2020 08:29:09 +0000 (11:29 +0300)
Some test code uses s1 and s2 as variable names.

Broken in 449539dc52070bebde3ae7babe96e6e272dd7101

src/lib-test/test-common.h

index 926de1e5e186092014f6472eb076316fc03364bf..a2f505cc0621f93380601423a12591e025a39f26 100644 (file)
@@ -37,11 +37,11 @@ void test_begin(const char *name);
  * tests failed like in test_assert_idx.
 */
 #define test_assert_strcmp_idx(_s1, _s2, i) STMT_START { \
-               const char *s1 = _s1; \
-               const char *s2 = _s2; \
-               if ((null_strcmp(s1,s2) != 0)) \
+               const char *_temp_s1 = (_s1); \
+               const char *_temp_s2 = (_s2); \
+               if ((null_strcmp(_temp_s1,_temp_s2) != 0)) \
                        test_assert_failed_strcmp_idx("strcmp(" #_s1 ","  #_s2 ")", \
-                                                     __FILE__, __LINE__, s1, s2, i); \
+                                                     __FILE__, __LINE__, _temp_s1, _temp_s2, i); \
        } STMT_END
 
 void test_assert_failed(const char *code, const char *file, unsigned int line);