summaryrefslogtreecommitdiffstats
path: root/tests/check-compat.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/check-compat.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/check-compat.h b/tests/check-compat.h
new file mode 100644
index 0000000..3236d78
--- /dev/null
+++ b/tests/check-compat.h
@@ -0,0 +1,16 @@
+#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