aboutsummaryrefslogtreecommitdiff
path: root/atf-c/macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'atf-c/macros.h')
-rw-r--r--atf-c/macros.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/atf-c/macros.h b/atf-c/macros.h
index 485a159acecb..1784fc47435d 100644
--- a/atf-c/macros.h
+++ b/atf-c/macros.h
@@ -185,6 +185,25 @@
"%s != %s (%s != %s): " fmt, \
#expected, #actual, expected, actual, ##__VA_ARGS__)
+#define ATF_REQUIRE_INTEQ(expected, actual) \
+ ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd)", \
+ #expected, #actual, (intmax_t)(expected), \
+ (intmax_t)(actual))
+
+#define ATF_CHECK_INTEQ(expected, actual) \
+ ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd)", #expected, \
+ #actual, (intmax_t)(expected), (intmax_t)(actual))
+
+#define ATF_REQUIRE_INTEQ_MSG(expected, actual, fmt, ...) \
+ ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \
+ #expected, #actual, (intmax_t)(expected), \
+ (intmax_t)(actual), ##__VA_ARGS__)
+
+#define ATF_CHECK_INTEQ_MSG(expected, actual, fmt, ...) \
+ ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \
+ #expected, #actual, (intmax_t)(expected), \
+ (intmax_t)(actual), ##__VA_ARGS__)
+
#define ATF_REQUIRE_MATCH(regexp, string) \
ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \
"'%s' not matched in '%s'", regexp, string);