LDADD = $(top_builddir)/src/daemon/liblldpd.la @CHECK_LIBS@ @LIBEVENT_LDFLAGS@
check_marshal_SOURCES = check_marshal.c \
- $(top_srcdir)/src/marshal.h
+ $(top_srcdir)/src/marshal.h \
+ check-compat.h
check_pattern_SOURCES = check_pattern.c \
$(top_srcdir)/src/daemon/lldpd.h
check_lldp_SOURCES = check_lldp.c \
$(top_srcdir)/src/daemon/lldpd.h \
- common.h common.c
+ common.h common.c check-compat.h
check_cdp_SOURCES = check_cdp.c \
$(top_srcdir)/src/daemon/lldpd.h \
- common.h common.c
+ common.h common.c check-compat.h
check_sonmp_SOURCES = check_sonmp.c \
$(top_srcdir)/src/daemon/lldpd.h \
- common.h common.c
+ common.h common.c check-compat.h
check_edp_SOURCES = check_edp.c \
$(top_srcdir)/src/daemon/lldpd.h \
- common.h common.c
+ common.h common.c check-compat.h
check_fixedpoint_SOURCES = check_fixedpoint.c
check_fixedpoint_LDADD = $(top_builddir)/src/lib/libfixedpoint.la $(LDADD)
--- /dev/null
+#ifndef _CHECK_COMPAT_H
+#define _CHECK_COMPAT_H
+
+#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
+
+#endif
ck_assert_int_eq(nport->p_id_len, ETHER_ADDR_LEN);
fail_unless(memcmp(mac2, nport->p_id, ETHER_ADDR_LEN) == 0);
ck_assert_int_eq(nchassis->c_ttl, 120);
- ck_assert_int_eq(nchassis->c_name, NULL);
- ck_assert_int_eq(nchassis->c_descr, NULL);
- ck_assert_int_eq(nport->p_descr, NULL);
+ ck_assert_ptr_eq(nchassis->c_name, NULL);
+ ck_assert_ptr_eq(nchassis->c_descr, NULL);
+ ck_assert_ptr_eq(nport->p_descr, NULL);
}
END_TEST
#include <sys/queue.h>
#define MARSHAL_EXPORT
+#include "check-compat.h"
#include "../src/marshal.h"
#include "../src/log.h"
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) {};
#ifndef _COMMON_H
#define _COMMON_H
+#include "check-compat.h"
#include "../src/daemon/lldpd.h"
/* See: