#define _ck_assert_int(X, OP, Y) do { \
intmax_t _ck_x = (X); \
intmax_t _ck_y = (Y); \
- ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: %s==%jd, %s==%jd", #X#OP#Y, #X, _ck_x, #Y, _ck_y); \
+ ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: %s == %jd, %s == %jd", #X" "#OP" "#Y, #X, _ck_x, #Y, _ck_y); \
} while (0)
/**
#define _ck_assert_uint(X, OP, Y) do { \
uintmax_t _ck_x = (X); \
uintmax_t _ck_y = (Y); \
- ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: %s==%ju, %s==%ju", #X#OP#Y, #X, _ck_x, #Y, _ck_y); \
+ ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: %s == %ju, %s == %ju", #X" "#OP" "#Y, #X, _ck_x, #Y, _ck_y); \
} while (0)
/**
* Check two unsigned integers to determine if X==Y
const char* _ck_x = (X); \
const char* _ck_y = (Y); \
ck_assert_msg(0 OP strcmp(_ck_y, _ck_x), \
- "Assertion '%s' failed: %s==\"%s\", %s==\"%s\"", #X#OP#Y, #X, _ck_x, #Y, _ck_y); \
+ "Assertion '%s' failed: %s == \"%s\", %s == \"%s\"", #X" "#OP" "#Y, #X, _ck_x, #Y, _ck_y); \
} while (0)
/**
* Check two strings to determine if 0==strcmp(X,Y)
#define _ck_assert_ptr(X, OP, Y) do { \
const void* _ck_x = (X); \
const void* _ck_y = (Y); \
- ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: %s==%#x, %s==%#x", #X#OP#Y, #X, _ck_x, #Y, _ck_y); \
+ ck_assert_msg(_ck_x OP _ck_y, "Assertion '%s' failed: %s == %#x, %s == %#x", #X" "#OP" "#Y, #X, _ck_x, #Y, _ck_y); \
} while (0)
/**
{ "Simple Tests", CK_FAILURE, "Assertion 'x == y' failed" },
{ "Simple Tests", CK_FAILURE, "Assertion '0' failed" },
{ "Simple Tests", CK_FAILURE, "Assertion '1%f == 1' failed" },
- { "Simple Tests", CK_FAILURE, "Assertion 'x==y' failed: x==3, y==4" },
- { "Simple Tests", CK_FAILURE, "Assertion '3%d==2%f' failed: 3%d==1, 2%f==0" },
- { "Simple Tests", CK_FAILURE, "Assertion 'x!=y' failed: x==3, y==3" },
- { "Simple Tests", CK_FAILURE, "Assertion '3%d!=3%f' failed: 3%d==1, 3%f==1" },
- { "Simple Tests", CK_FAILURE, "Assertion 'x<x' failed: x==2, x==2" },
- { "Simple Tests", CK_FAILURE, "Assertion '3%d<3%f' failed: 3%d==1, 3%f==0" },
- { "Simple Tests", CK_FAILURE, "Assertion 'y<=x' failed: y==3, x==2" },
- { "Simple Tests", CK_FAILURE, "Assertion '3%d<=2%f' failed: 3%d==1, 2%f==0" },
- { "Simple Tests", CK_FAILURE, "Assertion 'y>y' failed: y==3, y==3" },
- { "Simple Tests", CK_FAILURE, "Assertion '3%d>3%f' failed: 3%d==0, 3%f==1" },
- { "Simple Tests", CK_FAILURE, "Assertion 'x>=y' failed: x==2, y==3" },
- { "Simple Tests", CK_FAILURE, "Assertion '3%d>=4%f' failed: 3%d==0, 4%f==1" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'x == y' failed: x == 3, y == 4" },
+ { "Simple Tests", CK_FAILURE, "Assertion '3%d == 2%f' failed: 3%d == 1, 2%f == 0" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'x != y' failed: x == 3, y == 3" },
+ { "Simple Tests", CK_FAILURE, "Assertion '3%d != 3%f' failed: 3%d == 1, 3%f == 1" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'x < x' failed: x == 2, x == 2" },
+ { "Simple Tests", CK_FAILURE, "Assertion '3%d < 3%f' failed: 3%d == 1, 3%f == 0" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'y <= x' failed: y == 3, x == 2" },
+ { "Simple Tests", CK_FAILURE, "Assertion '3%d <= 2%f' failed: 3%d == 1, 2%f == 0" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'y > y' failed: y == 3, y == 3" },
+ { "Simple Tests", CK_FAILURE, "Assertion '3%d > 3%f' failed: 3%d == 0, 3%f == 1" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'x >= y' failed: x == 2, y == 3" },
+ { "Simple Tests", CK_FAILURE, "Assertion '3%d >= 4%f' failed: 3%d == 0, 4%f == 1" },
{ "Simple Tests", CK_PASS, "Passed" },
- { "Simple Tests", CK_FAILURE, "Assertion 'x==y' failed: x==3, y==4" },
- { "Simple Tests", CK_FAILURE, "Assertion '3%d==1%f' failed: 3%d==1, 1%f==0" },
- { "Simple Tests", CK_FAILURE, "Assertion 'x!=y' failed: x==3, y==3" },
- { "Simple Tests", CK_FAILURE, "Assertion '1%d!=1%f' failed: 1%d==0, 1%f==0" },
- { "Simple Tests", CK_FAILURE, "Assertion 'x<x' failed: x==2, x==2" },
- { "Simple Tests", CK_FAILURE, "Assertion '3%d<1%f' failed: 3%d==1, 1%f==0" },
- { "Simple Tests", CK_FAILURE, "Assertion 'y<=x' failed: y==3, x==2" },
- { "Simple Tests", CK_FAILURE, "Assertion '3%d<=1%f' failed: 3%d==1, 1%f==0" },
- { "Simple Tests", CK_FAILURE, "Assertion 'y>y' failed: y==3, y==3" },
- { "Simple Tests", CK_FAILURE, "Assertion '1%d>3%f' failed: 1%d==0, 3%f==1" },
- { "Simple Tests", CK_FAILURE, "Assertion 'x>=y' failed: x==2, y==3" },
- { "Simple Tests", CK_FAILURE, "Assertion '1%d>=3%f' failed: 1%d==0, 3%f==1" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'x == y' failed: x == 3, y == 4" },
+ { "Simple Tests", CK_FAILURE, "Assertion '3%d == 1%f' failed: 3%d == 1, 1%f == 0" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'x != y' failed: x == 3, y == 3" },
+ { "Simple Tests", CK_FAILURE, "Assertion '1%d != 1%f' failed: 1%d == 0, 1%f == 0" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'x < x' failed: x == 2, x == 2" },
+ { "Simple Tests", CK_FAILURE, "Assertion '3%d < 1%f' failed: 3%d == 1, 1%f == 0" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'y <= x' failed: y == 3, x == 2" },
+ { "Simple Tests", CK_FAILURE, "Assertion '3%d <= 1%f' failed: 3%d == 1, 1%f == 0" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'y > y' failed: y == 3, y == 3" },
+ { "Simple Tests", CK_FAILURE, "Assertion '1%d > 3%f' failed: 1%d == 0, 3%f == 1" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'x >= y' failed: x == 2, y == 3" },
+ { "Simple Tests", CK_FAILURE, "Assertion '1%d >= 3%f' failed: 1%d == 0, 3%f == 1" },
{ "Simple Tests", CK_PASS, "Passed" },
- { "Simple Tests", CK_FAILURE, "Assertion '\"test1\"==s' failed: \"test1\"==\"test1\", s==\"test2\"" },
- { "Simple Tests", CK_FAILURE, "Assertion 't!=s' failed: t==\"test2\", s==\"test2\"" },
- { "Simple Tests", CK_FAILURE, "Assertion 's<s' failed: s==\"test1\", s==\"test1\"" },
- { "Simple Tests", CK_FAILURE, "Assertion 't<=s' failed: t==\"test2\", s==\"test1\"" },
- { "Simple Tests", CK_FAILURE, "Assertion 't>t' failed: t==\"test2\", t==\"test2\"" },
- { "Simple Tests", CK_FAILURE, "Assertion 's>=t' failed: s==\"test1\", t==\"test2\"" },
+ { "Simple Tests", CK_FAILURE, "Assertion '\"test1\" == s' failed: \"test1\" == \"test1\", s == \"test2\"" },
+ { "Simple Tests", CK_FAILURE, "Assertion 't != s' failed: t == \"test2\", s == \"test2\"" },
+ { "Simple Tests", CK_FAILURE, "Assertion 's < s' failed: s == \"test1\", s == \"test1\"" },
+ { "Simple Tests", CK_FAILURE, "Assertion 't <= s' failed: t == \"test2\", s == \"test1\"" },
+ { "Simple Tests", CK_FAILURE, "Assertion 't > t' failed: t == \"test2\", t == \"test2\"" },
+ { "Simple Tests", CK_FAILURE, "Assertion 's >= t' failed: s == \"test1\", t == \"test2\"" },
{ "Simple Tests", CK_PASS, "Passed" },
- { "Simple Tests", CK_FAILURE, "Assertion 'x==y' failed: x==0x1, y==0x2" },
- { "Simple Tests", CK_FAILURE, "Assertion 'x!=z' failed: x==0x1, z==0x1" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'x == y' failed: x == 0x1, y == 0x2" },
+ { "Simple Tests", CK_FAILURE, "Assertion 'x != z' failed: x == 0x1, z == 0x1" },
#if defined(HAVE_FORK) && HAVE_FORK==1
{ "Signal Tests", CK_ERROR, signal_11_str },