From e5f8577840e1a0689add9a4374af69d35b59a851 Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Mon, 23 Dec 2024 19:03:37 -0500 Subject: [PATCH] tests: Add some backwards compat for libCheck macros Signed-off-by: Ben Collins --- tests/jwt_tests.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/jwt_tests.h b/tests/jwt_tests.h index ae8600a9..9b2eb8e2 100644 --- a/tests/jwt_tests.h +++ b/tests/jwt_tests.h @@ -20,14 +20,19 @@ #endif /* Compatibility with older libCheck versions */ -/* Older check doesn't have this. */ #ifndef ck_assert_ptr_ne -#define ck_assert_ptr_ne(X, Y) ck_assert(X != Y) -#define ck_assert_ptr_eq(X, Y) ck_assert(X == Y) +#define ck_assert_ptr_ne(__X, __Y) ck_assert(__X != __Y) +#define ck_assert_ptr_eq(__X, __Y) ck_assert(__X == __Y) #endif #ifndef ck_assert_int_gt -#define ck_assert_int_gt(X, Y) ck_assert(X > Y) +#define ck_assert_int_gt(__X, __Y) ck_assert(__X > __Y) +#define ck_assert_int_lt(__X, __Y) ck_assert(__X < __Y) +#endif + +#ifndef ck_assert_ptr_null +#define ck_assert_ptr_null(__X) ck_assert(__X == NULL) +#define ck_assert_ptr_nonnull(__X) ck_assert(__X != NULL) #endif /* Constant time to make tests consistent. */