]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
tests: define ck_assert_ptr_eq if check is too old
authorVincent Bernat <bernat@luffy.cx>
Sun, 23 Jun 2013 07:09:13 +0000 (09:09 +0200)
committerVincent Bernat <bernat@luffy.cx>
Sun, 23 Jun 2013 07:14:13 +0000 (09:14 +0200)
tests/check_marshal.c

index fa7d80f2d53e037d67ce8102fdc3f42cbb8eecd6..53b72ee7784134c61c31c5fd05efebdca998de87 100644 (file)
    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) {};