Skip to content

Commit

Permalink
tests: Add some backwards compat for libCheck macros
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Collins <[email protected]>
  • Loading branch information
benmcollins committed Dec 24, 2024
1 parent 03637ca commit e5f8577
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/jwt_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit e5f8577

Please sign in to comment.