Module Name:    src
Committed By:   rillig
Date:           Wed Jul 10 19:37:41 UTC 2024

Modified Files:
        src/external/bsd/atf/dist/atf-c: macros.h

Log Message:
atf-c: detect accidental '=' in assertion condition

Seen several times in tests/libc/c063.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.8 -r1.2 src/external/bsd/atf/dist/atf-c/macros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/macros.h
diff -u src/external/bsd/atf/dist/atf-c/macros.h:1.1.1.8 src/external/bsd/atf/dist/atf-c/macros.h:1.2
--- src/external/bsd/atf/dist/atf-c/macros.h:1.1.1.8	Fri Feb 15 17:04:15 2013
+++ src/external/bsd/atf/dist/atf-c/macros.h	Wed Jul 10 19:37:41 2024
@@ -133,25 +133,25 @@
 
 #define ATF_REQUIRE_MSG(x, fmt, ...) \
     do { \
-        if (!(x)) \
+        if (x) {} else \
             atf_tc_fail_requirement(__FILE__, __LINE__, fmt, ##__VA_ARGS__); \
     } while(0)
 
 #define ATF_CHECK_MSG(x, fmt, ...) \
     do { \
-        if (!(x)) \
+        if (x) {} else \
             atf_tc_fail_check(__FILE__, __LINE__, fmt, ##__VA_ARGS__); \
     } while(0)
 
 #define ATF_REQUIRE(x) \
     do { \
-        if (!(x)) \
+        if (x) {} else \
             atf_tc_fail_requirement(__FILE__, __LINE__, "%s", #x " not met"); \
     } while(0)
 
 #define ATF_CHECK(x) \
     do { \
-        if (!(x)) \
+        if (x) {} else \
             atf_tc_fail_check(__FILE__, __LINE__, "%s", #x " not met"); \
     } while(0)
 

Reply via email to