From: Vincent Bernat Date: Sun, 23 Jun 2013 07:09:13 +0000 (+0200) Subject: tests: define ck_assert_ptr_eq if check is too old X-Git-Tag: 0.7.6~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c6540ece3ea7f69690e2b02a94f32c8b377e8528;p=thirdparty%2Flldpd.git tests: define ck_assert_ptr_eq if check is too old --- diff --git a/tests/check_marshal.c b/tests/check_marshal.c index fa7d80f2..53b72ee7 100644 --- a/tests/check_marshal.c +++ b/tests/check_marshal.c @@ -11,6 +11,15 @@ CK_FORK=no valgrind -v --leak-check=yes ./tests/check_marshal */ +#if (CHECK_MAJOR_VERSION == 0 && (CHECK_MINOR_VERSION < 9 || (CHECK_MINOR_VERSION == 9 && CHECK_MICRO_VERSION < 10))) +# define ck_assert_ptr_eq(X,Y) do { \ + void* _ck_x = (X); \ + void* _ck_y = (Y); \ + ck_assert_msg(_ck_x == _ck_y, \ + "Assertion '"#X"=="#Y"' failed: "#X"==%p, "#Y"==%p", \ + _ck_x, _ck_y); \ + } while (0) +#endif /* Use this callback to avoid some logs */ void donothing(int pri, const char *msg) {};