]> git.codecow.com Git - Monocypher.git/commitdiff
More elegant ASSERT
authorLoup Vaillant <loup@loup-vaillant.fr>
Mon, 12 Dec 2022 20:57:05 +0000 (21:57 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Mon, 12 Dec 2022 20:57:05 +0000 (21:57 +0100)
tests/utils.h

index d0f5e6fd7a794013a262606da01975769744fb4f..78d55fdb86a92d9acd3448eae4f019251d1250ab 100644 (file)
@@ -72,8 +72,8 @@ typedef uint64_t u64;
                        exit(1); \
                } \
        } while (0)
-#define ASSERT_EQUAL(a, b, size)     ASSERT( memcmp(a, b, size) == 0)
-#define ASSERT_DIFFERENT(a, b, size) ASSERT(!memcmp(a, b, size) == 0)
+#define ASSERT_EQUAL(a, b, size)     ASSERT(memcmp(a, b, size) == 0)
+#define ASSERT_DIFFERENT(a, b, size) ASSERT(memcmp(a, b, size) != 0)
 #define ASSERT_OK(exp)               ASSERT((exp) == 0)
 #define ASSERT_KO(exp)               ASSERT((exp) != 0)