From: Michael Tremer Date: Wed, 26 Oct 2022 19:41:00 +0000 (+0000) Subject: tests: Add a test that checks if two values are equal X-Git-Tag: 0.9.28~203 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=984f134fc6c9a2b89522ccf88017c64ac8fca334;p=pakfire.git tests: Add a test that checks if two values are equal Signed-off-by: Michael Tremer --- diff --git a/tests/testsuite.h b/tests/testsuite.h index fe9c3f3a7..4661ea168 100644 --- a/tests/testsuite.h +++ b/tests/testsuite.h @@ -169,6 +169,15 @@ ERROR: } \ } while (0) +#define ASSERT_EQUALS(value1, value2) \ + do { \ + if (value1 != value2) { \ + LOG_ERROR("Failed assertion: " #value1 " (%lld) != " #value2 " (%lld) %s:%d %s\n", \ + value1, value2, __FILE__, __LINE__, __PRETTY_FUNCTION__); \ + goto FAIL; \ + } \ + } while (0) + #define ASSERT_STRING_EQUALS(value, string) \ do { \ if (!value) { \