summaryrefslogtreecommitdiffstats
path: root/tests/check-compat.h
blob: 3236d78d717e99f2e0317b07a71c965197bbb0f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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