From: Loup Vaillant Date: Mon, 12 Dec 2022 20:57:05 +0000 (+0100) Subject: More elegant ASSERT X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=47469766a31b410b5892db67a0168cf795b7d0a7;p=Monocypher.git More elegant ASSERT --- 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)