From 47469766a31b410b5892db67a0168cf795b7d0a7 Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Mon, 12 Dec 2022 21:57:05 +0100 Subject: [PATCH] More elegant ASSERT --- tests/utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils.h b/tests/utils.h index d0f5e6f..78d55fd 100644 --- a/tests/utils.h +++ b/tests/utils.h @@ -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) -- 2.47.3