]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
tests: Add a test that checks if two values are equal
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 26 Oct 2022 19:41:00 +0000 (19:41 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 26 Oct 2022 19:41:00 +0000 (19:41 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/testsuite.h

index fe9c3f3a7f797f4a69e24d05d457289a184906f9..4661ea168c96458ce9b4225774687a491228de48 100644 (file)
@@ -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) { \