diff --git a/KWStyle.xml b/KWStyle.xml new file mode 100644 index 00000000..ae53685d --- /dev/null +++ b/KWStyle.xml @@ -0,0 +1,29 @@ + + + + + + 169 + 2 + true + + + 3 + 1 + + [a-z_] + 439 + + + /* + * + */ + false + + diff --git a/tests/Makefile.am b/tests/Makefile.am index 06bf29dd..8b9ff341 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -28,7 +28,15 @@ noinst_PROGRAMS = \ check_mem_leaks \ ex_output -EXTRA_DIST = test_output.sh test_check_nofork.sh test_check_nofork_teardown.sh test_log_output.sh test_vars.in test_xml_output.sh test_tap_output.sh test_mem_leaks.sh test_output_strings +EXTRA_DIST = \ + test_check_nofork.sh test_check_nofork_teardown.sh \ + test_log_output.sh \ + test_vars.in \ + test_mem_leaks.sh \ + test_output.sh \ + test_output_strings \ + test_tap_output.sh \ + test_xml_output.sh if NO_TIMEOUT_TESTS check_check_CFLAGS = -DTIMEOUT_TESTS_ENABLED=0 diff --git a/tests/check_check_log.c b/tests/check_check_log.c index ee36fde5..9479ae4f 100644 --- a/tests/check_check_log.c +++ b/tests/check_check_log.c @@ -312,4 +312,3 @@ Suite *make_log_suite(void) return s; } - diff --git a/tests/check_check_log_internal.c b/tests/check_check_log_internal.c index 01014324..0991da7c 100644 --- a/tests/check_check_log_internal.c +++ b/tests/check_check_log_internal.c @@ -72,4 +72,3 @@ Suite *make_log_internal_suite(void) return s; } - diff --git a/tests/check_check_master.c b/tests/check_check_master.c index a78a274b..51dad66c 100644 --- a/tests/check_check_master.c +++ b/tests/check_check_master.c @@ -78,9 +78,11 @@ static master_test_t master_tests[] = { #if defined(__GNUC__) { "Simple Tests", "test_fail_no_msg", CK_FAILURE, CK_MSG_TEXT, "Assertion '4 == 5' failed" }, #endif /* __GNUC__ */ - { "Simple Tests", "test_fail_if_null_msg", CK_FAILURE, CK_MSG_TEXT, "Failure '2 != 3' occurred" }, + { "Simple Tests", "test_fail_if_null_msg", CK_FAILURE, CK_MSG_TEXT, + "Failure '2 != 3' occurred" }, #if defined(__GNUC__) - { "Simple Tests", "test_fail_if_no_msg", CK_FAILURE, CK_MSG_TEXT, "Failure '4 != 5' occurred" }, + { "Simple Tests", "test_fail_if_no_msg", CK_FAILURE, CK_MSG_TEXT, + "Failure '4 != 5' occurred" }, #endif /* __GNUC__ */ { "Simple Tests", "test_fail_vararg_msg_1", CK_FAILURE, CK_MSG_TEXT, "3 != 4" }, { "Simple Tests", "test_fail_vararg_msg_2", CK_FAILURE, CK_MSG_TEXT, "5 != 6" }, @@ -91,67 +93,124 @@ static master_test_t master_tests[] = { { "Simple Tests", "test_ck_abort", CK_FAILURE, CK_MSG_TEXT, "Failed" }, { "Simple Tests", "test_ck_abort_msg", CK_FAILURE, CK_MSG_TEXT, "Failure expected" }, { "Simple Tests", "test_ck_abort_msg_null", CK_FAILURE, CK_MSG_TEXT, "Failed" }, - { "Simple Tests", "test_ck_assert", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x == y' failed" }, - { "Simple Tests", "test_ck_assert_null", CK_FAILURE, CK_MSG_TEXT, "Assertion '0' failed" }, - { "Simple Tests", "test_ck_assert_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '1%f == 1' failed" }, - { "Simple Tests", "test_ck_assert_int_eq", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x == y' failed: x == 3, y == 4" }, - { "Simple Tests", "test_ck_assert_int_eq_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d == 2%f' failed: 3%d == 1, 2%f == 0" }, - { "Simple Tests", "test_ck_assert_int_ne", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x != y' failed: x == 3, y == 3" }, - { "Simple Tests", "test_ck_assert_int_ne_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d != 3%f' failed: 3%d == 1, 3%f == 1" }, - { "Simple Tests", "test_ck_assert_int_lt", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x < x' failed: x == 2, x == 2" }, - { "Simple Tests", "test_ck_assert_int_lt_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d < 3%f' failed: 3%d == 1, 3%f == 0" }, - { "Simple Tests", "test_ck_assert_int_le", CK_FAILURE, CK_MSG_TEXT, "Assertion 'y <= x' failed: y == 3, x == 2" }, - { "Simple Tests", "test_ck_assert_int_le_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d <= 2%f' failed: 3%d == 1, 2%f == 0" }, - { "Simple Tests", "test_ck_assert_int_gt", CK_FAILURE, CK_MSG_TEXT, "Assertion 'y > y' failed: y == 3, y == 3" }, - { "Simple Tests", "test_ck_assert_int_gt_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d > 3%f' failed: 3%d == 0, 3%f == 1" }, - { "Simple Tests", "test_ck_assert_int_ge", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x >= y' failed: x == 2, y == 3" }, - { "Simple Tests", "test_ck_assert_int_ge_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d >= 4%f' failed: 3%d == 0, 4%f == 1" }, + { "Simple Tests", "test_ck_assert", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x == y' failed" }, + { "Simple Tests", "test_ck_assert_null", CK_FAILURE, CK_MSG_TEXT, + "Assertion '0' failed" }, + { "Simple Tests", "test_ck_assert_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '1%f == 1' failed" }, + { "Simple Tests", "test_ck_assert_int_eq", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x == y' failed: x == 3, y == 4" }, + { "Simple Tests", "test_ck_assert_int_eq_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d == 2%f' failed: 3%d == 1, 2%f == 0" }, + { "Simple Tests", "test_ck_assert_int_ne", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x != y' failed: x == 3, y == 3" }, + { "Simple Tests", "test_ck_assert_int_ne_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d != 3%f' failed: 3%d == 1, 3%f == 1" }, + { "Simple Tests", "test_ck_assert_int_lt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x < x' failed: x == 2, x == 2" }, + { "Simple Tests", "test_ck_assert_int_lt_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d < 3%f' failed: 3%d == 1, 3%f == 0" }, + { "Simple Tests", "test_ck_assert_int_le", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'y <= x' failed: y == 3, x == 2" }, + { "Simple Tests", "test_ck_assert_int_le_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d <= 2%f' failed: 3%d == 1, 2%f == 0" }, + { "Simple Tests", "test_ck_assert_int_gt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'y > y' failed: y == 3, y == 3" }, + { "Simple Tests", "test_ck_assert_int_gt_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d > 3%f' failed: 3%d == 0, 3%f == 1" }, + { "Simple Tests", "test_ck_assert_int_ge", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x >= y' failed: x == 2, y == 3" }, + { "Simple Tests", "test_ck_assert_int_ge_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d >= 4%f' failed: 3%d == 0, 4%f == 1" }, { "Simple Tests", "test_ck_assert_int_expr", CK_PASS, CK_MSG_TEXT, "Passed" }, - { "Simple Tests", "test_ck_assert_uint_eq", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x == y' failed: x == 3, y == 4" }, - { "Simple Tests", "test_ck_assert_uint_eq_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d == 1%f' failed: 3%d == 1, 1%f == 0" }, - { "Simple Tests", "test_ck_assert_uint_ne", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x != y' failed: x == 3, y == 3" }, - { "Simple Tests", "test_ck_assert_uint_ne_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '1%d != 1%f' failed: 1%d == 0, 1%f == 0" }, - { "Simple Tests", "test_ck_assert_uint_lt", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x < x' failed: x == 2, x == 2" }, - { "Simple Tests", "test_ck_assert_uint_lt_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d < 1%f' failed: 3%d == 1, 1%f == 0" }, - { "Simple Tests", "test_ck_assert_uint_le", CK_FAILURE, CK_MSG_TEXT, "Assertion 'y <= x' failed: y == 3, x == 2" }, - { "Simple Tests", "test_ck_assert_uint_le_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d <= 1%f' failed: 3%d == 1, 1%f == 0" }, - { "Simple Tests", "test_ck_assert_uint_gt", CK_FAILURE, CK_MSG_TEXT, "Assertion 'y > y' failed: y == 3, y == 3" }, - { "Simple Tests", "test_ck_assert_uint_gt_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '1%d > 3%f' failed: 1%d == 0, 3%f == 1" }, - { "Simple Tests", "test_ck_assert_uint_ge", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x >= y' failed: x == 2, y == 3" }, - { "Simple Tests", "test_ck_assert_uint_ge_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '1%d >= 3%f' failed: 1%d == 0, 3%f == 1" }, + { "Simple Tests", "test_ck_assert_uint_eq", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x == y' failed: x == 3, y == 4" }, + { "Simple Tests", "test_ck_assert_uint_eq_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d == 1%f' failed: 3%d == 1, 1%f == 0" }, + { "Simple Tests", "test_ck_assert_uint_ne", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x != y' failed: x == 3, y == 3" }, + { "Simple Tests", "test_ck_assert_uint_ne_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '1%d != 1%f' failed: 1%d == 0, 1%f == 0" }, + { "Simple Tests", "test_ck_assert_uint_lt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x < x' failed: x == 2, x == 2" }, + { "Simple Tests", "test_ck_assert_uint_lt_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d < 1%f' failed: 3%d == 1, 1%f == 0" }, + { "Simple Tests", "test_ck_assert_uint_le", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'y <= x' failed: y == 3, x == 2" }, + { "Simple Tests", "test_ck_assert_uint_le_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d <= 1%f' failed: 3%d == 1, 1%f == 0" }, + { "Simple Tests", "test_ck_assert_uint_gt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'y > y' failed: y == 3, y == 3" }, + { "Simple Tests", "test_ck_assert_uint_gt_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '1%d > 3%f' failed: 1%d == 0, 3%f == 1" }, + { "Simple Tests", "test_ck_assert_uint_ge", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x >= y' failed: x == 2, y == 3" }, + { "Simple Tests", "test_ck_assert_uint_ge_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '1%d >= 3%f' failed: 1%d == 0, 3%f == 1" }, { "Simple Tests", "test_ck_assert_uint_expr", CK_PASS, CK_MSG_TEXT, "Passed" }, /* Tests on float macros */ - { "Simple Tests", "test_ck_assert_float_eq", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x == y' failed: x == 1.1, y == 1.2" }, - { "Simple Tests", "test_ck_assert_float_eq_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d == 2%f' failed: 3%d == 1, 2%f == 0" }, - { "Simple Tests", "test_ck_assert_float_ne", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x != y' failed: x == 1.1, y == 1.1" }, - { "Simple Tests", "test_ck_assert_float_ne_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '1%d != 1%f' failed: 1%d == 1, 1%f == 1" }, - { "Simple Tests", "test_ck_assert_float_lt", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x < y' failed: x == 2, y == 1.5" }, - { "Simple Tests", "test_ck_assert_float_lt_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d < 2%f' failed: 3%d == 1, 2%f == 0" }, - { "Simple Tests", "test_ck_assert_float_le", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x <= y' failed: x == 2, y == 1.5" }, - { "Simple Tests", "test_ck_assert_float_le_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d <= 2%f' failed: 3%d == 1, 2%f == 0" }, - { "Simple Tests", "test_ck_assert_float_gt", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x > y' failed: x == 2.5, y == 3" }, - { "Simple Tests", "test_ck_assert_float_gt_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d > 3%f' failed: 2%d == 0, 3%f == 1" }, - { "Simple Tests", "test_ck_assert_float_ge", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x >= y' failed: x == 2.5, y == 3" }, - { "Simple Tests", "test_ck_assert_float_ge_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d >= 3%f' failed: 2%d == 0, 3%f == 1" }, - { "Simple Tests", "test_ck_assert_float_with_expr", CK_PASS, CK_MSG_TEXT, "Passed" }, - { "Simple Tests", "test_ck_assert_float_eq_tol", CK_FAILURE, CK_MSG_TEXT, "Assertion 'fabsl(y - x) < t' failed: x == 0.001, y == 0.003, t == 0.001" }, - { "Simple Tests", "test_ck_assert_float_eq_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion 'fabsl(2%f - 3%d) < 2%p' failed: 3%d == 1, 2%f == 0, 2%p == 0" }, - { "Simple Tests", "test_ck_assert_float_ne_tol", CK_FAILURE, CK_MSG_TEXT, "Assertion 'fabsl(y - x) >= t' failed: x == 0.001, y == 0.002, t == 0.01" }, - { "Simple Tests", "test_ck_assert_float_ne_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion 'fabsl(3%f - 3%d) >= 3%p' failed: 3%d == 1, 3%f == 1, 3%p == 1" }, - { "Simple Tests", "test_ck_assert_float_ge_tol", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x >= y, error < t' failed: x == 0.01, y == 0.03, t == 0.01" }, - { "Simple Tests", "test_ck_assert_float_ge_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d >= 3%f, error < 3%p' failed: 2%d == 0, 3%f == 1, 3%p == 1" }, - { "Simple Tests", "test_ck_assert_float_le_tol", CK_FAILURE, CK_MSG_TEXT, "Assertion 'y <= x, error < t' failed: y == 0.03, x == 0.01, t == 0.01" }, - { "Simple Tests", "test_ck_assert_float_le_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d <= 2%f, error < 3%p' failed: 3%d == 1, 2%f == 0, 3%p == 1" }, - { "Simple Tests", "test_ck_assert_float_tol_with_expr", CK_PASS, CK_MSG_TEXT, "Passed" }, - { "Simple Tests", "test_ck_assert_float_finite", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x is finite' failed: x == inf" }, - { "Simple Tests", "test_ck_assert_float_finite_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x*(1%d) is finite' failed: x*(1%d) == inf" }, - { "Simple Tests", "test_ck_assert_float_infinite", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x is infinite' failed: x == 0" }, - { "Simple Tests", "test_ck_assert_float_infinite_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d is infinite' failed: 2%d == 0" }, - { "Simple Tests", "test_ck_assert_float_nan", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x is NaN' failed: x == inf" }, - { "Simple Tests", "test_ck_assert_float_nan_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d is NaN' failed: 2%d == 0" }, + { "Simple Tests", "test_ck_assert_float_eq", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x == y' failed: x == 1.1, y == 1.2" }, + { "Simple Tests", "test_ck_assert_float_eq_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d == 2%f' failed: 3%d == 1, 2%f == 0" }, + { "Simple Tests", "test_ck_assert_float_ne", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x != y' failed: x == 1.1, y == 1.1" }, + { "Simple Tests", "test_ck_assert_float_ne_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '1%d != 1%f' failed: 1%d == 1, 1%f == 1" }, + { "Simple Tests", "test_ck_assert_float_lt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x < y' failed: x == 2, y == 1.5" }, + { "Simple Tests", "test_ck_assert_float_lt_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d < 2%f' failed: 3%d == 1, 2%f == 0" }, + { "Simple Tests", "test_ck_assert_float_le", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x <= y' failed: x == 2, y == 1.5" }, + { "Simple Tests", "test_ck_assert_float_le_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d <= 2%f' failed: 3%d == 1, 2%f == 0" }, + { "Simple Tests", "test_ck_assert_float_gt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x > y' failed: x == 2.5, y == 3" }, + { "Simple Tests", "test_ck_assert_float_gt_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d > 3%f' failed: 2%d == 0, 3%f == 1" }, + { "Simple Tests", "test_ck_assert_float_ge", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x >= y' failed: x == 2.5, y == 3" }, + { "Simple Tests", "test_ck_assert_float_ge_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d >= 3%f' failed: 2%d == 0, 3%f == 1" }, + { "Simple Tests", "test_ck_assert_float_with_expr", CK_PASS, CK_MSG_TEXT, + "Passed" }, + { "Simple Tests", "test_ck_assert_float_eq_tol", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'fabsl(y - x) < t' failed: x == 0.001, y == 0.003, t == 0.001" }, + { "Simple Tests", "test_ck_assert_float_eq_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'fabsl(2%f - 3%d) < 2%p' failed: 3%d == 1, 2%f == 0, 2%p == 0" }, + { "Simple Tests", "test_ck_assert_float_ne_tol", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'fabsl(y - x) >= t' failed: x == 0.001, y == 0.002, t == 0.01" }, + { "Simple Tests", "test_ck_assert_float_ne_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'fabsl(3%f - 3%d) >= 3%p' failed: 3%d == 1, 3%f == 1, 3%p == 1" }, + { "Simple Tests", "test_ck_assert_float_ge_tol", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x >= y, error < t' failed: x == 0.01, y == 0.03, t == 0.01" }, + { "Simple Tests", "test_ck_assert_float_ge_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d >= 3%f, error < 3%p' failed: 2%d == 0, 3%f == 1, 3%p == 1" }, + { "Simple Tests", "test_ck_assert_float_le_tol", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'y <= x, error < t' failed: y == 0.03, x == 0.01, t == 0.01" }, + { "Simple Tests", "test_ck_assert_float_le_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d <= 2%f, error < 3%p' failed: 3%d == 1, 2%f == 0, 3%p == 1" }, + { "Simple Tests", "test_ck_assert_float_tol_with_expr", CK_PASS, CK_MSG_TEXT, + "Passed" }, + { "Simple Tests", "test_ck_assert_float_finite", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x is finite' failed: x == inf" }, + { "Simple Tests", "test_ck_assert_float_finite_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x*(1%d) is finite' failed: x*(1%d) == inf" }, + { "Simple Tests", "test_ck_assert_float_infinite", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x is infinite' failed: x == 0" }, + { "Simple Tests", "test_ck_assert_float_infinite_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d is infinite' failed: 2%d == 0" }, + { "Simple Tests", "test_ck_assert_float_nan", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x is NaN' failed: x == inf" }, + { "Simple Tests", "test_ck_assert_float_nan_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d is NaN' failed: 2%d == 0" }, #if ENABLE_REGEX - { "Simple Tests", "test_ck_assert_float_nonnan", CK_FAILURE, CK_MSG_REGEXP, "^Assertion 'x is not NaN' failed: x == -?nan$" }, - { "Simple Tests", "test_ck_assert_float_nonnan_with_mod", CK_FAILURE, CK_MSG_REGEXP, "^Assertion '\\(2%s\\)\\*x is not NaN' failed: \\(2%s\\)\\*x == -?nan$" }, + { "Simple Tests", "test_ck_assert_float_nonnan", CK_FAILURE, CK_MSG_REGEXP, + "^Assertion 'x is not NaN' failed: x == -?nan$" }, + { "Simple Tests", "test_ck_assert_float_nonnan_with_mod", CK_FAILURE, CK_MSG_REGEXP, + "^Assertion '\\(2%s\\)\\*x is not NaN' failed: \\(2%s\\)\\*x == -?nan$" }, #else { "Simple Tests", "test_ck_assert_float_nonnan", CK_PASS, CK_MSG_TEXT, "Passed" }, { "Simple Tests", "test_ck_assert_float_nonnan_with_mod", CK_PASS, CK_MSG_TEXT, "Passed" }, @@ -159,39 +218,69 @@ static master_test_t master_tests[] = { { "Simple Tests", "test_ck_assert_float_nan_and_inf_with_expr", CK_PASS, CK_MSG_TEXT, "Passed" }, /* End of tests on float macros */ /* Tests on double macros */ - { "Simple Tests", "test_ck_assert_double_eq", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x == y' failed: x == 1.1, y == 1.2" }, - { "Simple Tests", "test_ck_assert_double_eq_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d == 2%f' failed: 3%d == 1, 2%f == 0" }, + { "Simple Tests", "test_ck_assert_double_eq", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x == y' failed: x == 1.1, y == 1.2" }, + { "Simple Tests", "test_ck_assert_double_eq_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d == 2%f' failed: 3%d == 1, 2%f == 0" }, { "Simple Tests", "test_ck_assert_double_eq_with_promotion", CK_PASS, CK_MSG_TEXT, "Passed" }, - { "Simple Tests", "test_ck_assert_double_eq_with_conv", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x == 0.1' failed: x == 0.1, 0.1 == 0.1" }, - { "Simple Tests", "test_ck_assert_double_ne", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x != y' failed: x == 1.1, y == 1.1" }, - { "Simple Tests", "test_ck_assert_double_ne_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '1%d != 1%f' failed: 1%d == 1, 1%f == 1" }, - { "Simple Tests", "test_ck_assert_double_lt", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x < y' failed: x == 2, y == 1.5" }, - { "Simple Tests", "test_ck_assert_double_lt_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d < 2%f' failed: 3%d == 1, 2%f == 0" }, - { "Simple Tests", "test_ck_assert_double_le", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x <= y' failed: x == 2, y == 1.5" }, - { "Simple Tests", "test_ck_assert_double_le_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d <= 2%f' failed: 3%d == 1, 2%f == 0" }, - { "Simple Tests", "test_ck_assert_double_gt", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x > y' failed: x == 2.5, y == 3" }, - { "Simple Tests", "test_ck_assert_double_gt_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d > 3%f' failed: 2%d == 0, 3%f == 1" }, - { "Simple Tests", "test_ck_assert_double_ge", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x >= y' failed: x == 2.5, y == 3" }, - { "Simple Tests", "test_ck_assert_double_ge_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d >= 3%f' failed: 2%d == 0, 3%f == 1" }, + { "Simple Tests", "test_ck_assert_double_eq_with_conv", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x == 0.1' failed: x == 0.1, 0.1 == 0.1" }, + { "Simple Tests", "test_ck_assert_double_ne", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x != y' failed: x == 1.1, y == 1.1" }, + { "Simple Tests", "test_ck_assert_double_ne_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '1%d != 1%f' failed: 1%d == 1, 1%f == 1" }, + { "Simple Tests", "test_ck_assert_double_lt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x < y' failed: x == 2, y == 1.5" }, + { "Simple Tests", "test_ck_assert_double_lt_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d < 2%f' failed: 3%d == 1, 2%f == 0" }, + { "Simple Tests", "test_ck_assert_double_le", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x <= y' failed: x == 2, y == 1.5" }, + { "Simple Tests", "test_ck_assert_double_le_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d <= 2%f' failed: 3%d == 1, 2%f == 0" }, + { "Simple Tests", "test_ck_assert_double_gt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x > y' failed: x == 2.5, y == 3" }, + { "Simple Tests", "test_ck_assert_double_gt_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d > 3%f' failed: 2%d == 0, 3%f == 1" }, + { "Simple Tests", "test_ck_assert_double_ge", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x >= y' failed: x == 2.5, y == 3" }, + { "Simple Tests", "test_ck_assert_double_ge_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d >= 3%f' failed: 2%d == 0, 3%f == 1" }, { "Simple Tests", "test_ck_assert_double_with_expr", CK_PASS, CK_MSG_TEXT, "Passed" }, - { "Simple Tests", "test_ck_assert_double_eq_tol", CK_FAILURE, CK_MSG_TEXT, "Assertion 'fabsl(y - x) < t' failed: x == 0.001, y == 0.002, t == 0.001" }, - { "Simple Tests", "test_ck_assert_double_eq_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion 'fabsl(2%f - 3%d) < 2%p' failed: 3%d == 1, 2%f == 0, 2%p == 0" }, - { "Simple Tests", "test_ck_assert_double_ne_tol", CK_FAILURE, CK_MSG_TEXT, "Assertion 'fabsl(y - x) >= t' failed: x == 0.001, y == 0.002, t == 0.01" }, - { "Simple Tests", "test_ck_assert_double_ne_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion 'fabsl(3%f - 3%d) >= 3%p' failed: 3%d == 1, 3%f == 1, 3%p == 1" }, - { "Simple Tests", "test_ck_assert_double_ge_tol", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x >= y, error < t' failed: x == 0.01, y == 0.03, t == 0.01" }, - { "Simple Tests", "test_ck_assert_double_ge_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d >= 3%f, error < 3%p' failed: 2%d == 0, 3%f == 1, 3%p == 1" }, - { "Simple Tests", "test_ck_assert_double_le_tol", CK_FAILURE, CK_MSG_TEXT, "Assertion 'y <= x, error < t' failed: y == 0.03, x == 0.01, t == 0.01" }, - { "Simple Tests", "test_ck_assert_double_le_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d <= 2%f, error < 3%p' failed: 3%d == 1, 2%f == 0, 3%p == 1" }, - { "Simple Tests", "test_ck_assert_double_tol_with_expr", CK_PASS, CK_MSG_TEXT, "Passed" }, - { "Simple Tests", "test_ck_assert_double_finite", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x is finite' failed: x == inf" }, - { "Simple Tests", "test_ck_assert_double_finite_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x*(1%d) is finite' failed: x*(1%d) == inf" }, - { "Simple Tests", "test_ck_assert_double_infinite", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x is infinite' failed: x == 0" }, - { "Simple Tests", "test_ck_assert_double_infinite_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d is infinite' failed: 2%d == 0" }, - { "Simple Tests", "test_ck_assert_double_nan", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x is NaN' failed: x == inf" }, - { "Simple Tests", "test_ck_assert_double_nan_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d is NaN' failed: 2%d == 0" }, + { "Simple Tests", "test_ck_assert_double_eq_tol", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'fabsl(y - x) < t' failed: x == 0.001, y == 0.002, t == 0.001" }, + { "Simple Tests", "test_ck_assert_double_eq_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'fabsl(2%f - 3%d) < 2%p' failed: 3%d == 1, 2%f == 0, 2%p == 0" }, + { "Simple Tests", "test_ck_assert_double_ne_tol", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'fabsl(y - x) >= t' failed: x == 0.001, y == 0.002, t == 0.01" }, + { "Simple Tests", "test_ck_assert_double_ne_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'fabsl(3%f - 3%d) >= 3%p' failed: 3%d == 1, 3%f == 1, 3%p == 1" }, + { "Simple Tests", "test_ck_assert_double_ge_tol", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x >= y, error < t' failed: x == 0.01, y == 0.03, t == 0.01" }, + { "Simple Tests", "test_ck_assert_double_ge_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d >= 3%f, error < 3%p' failed: 2%d == 0, 3%f == 1, 3%p == 1" }, + { "Simple Tests", "test_ck_assert_double_le_tol", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'y <= x, error < t' failed: y == 0.03, x == 0.01, t == 0.01" }, + { "Simple Tests", "test_ck_assert_double_le_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d <= 2%f, error < 3%p' failed: 3%d == 1, 2%f == 0, 3%p == 1" }, + { "Simple Tests", "test_ck_assert_double_tol_with_expr", CK_PASS, CK_MSG_TEXT, + "Passed" }, + { "Simple Tests", "test_ck_assert_double_finite", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x is finite' failed: x == inf" }, + { "Simple Tests", "test_ck_assert_double_finite_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x*(1%d) is finite' failed: x*(1%d) == inf" }, + { "Simple Tests", "test_ck_assert_double_infinite", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x is infinite' failed: x == 0" }, + { "Simple Tests", "test_ck_assert_double_infinite_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d is infinite' failed: 2%d == 0" }, + { "Simple Tests", "test_ck_assert_double_nan", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x is NaN' failed: x == inf" }, + { "Simple Tests", "test_ck_assert_double_nan_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d is NaN' failed: 2%d == 0" }, #if ENABLE_REGEX - { "Simple Tests", "test_ck_assert_double_nonnan", CK_FAILURE, CK_MSG_REGEXP, "^Assertion 'x is not NaN' failed: x == -?nan$" }, - { "Simple Tests", "test_ck_assert_double_nonnan_with_mod", CK_FAILURE, CK_MSG_REGEXP, "^Assertion '\\(2%s\\)\\*x is not NaN' failed: \\(2%s\\)\\*x == -?nan$" }, + { "Simple Tests", "test_ck_assert_double_nonnan", CK_FAILURE, CK_MSG_REGEXP, + "^Assertion 'x is not NaN' failed: x == -?nan$" }, + { "Simple Tests", "test_ck_assert_double_nonnan_with_mod", CK_FAILURE, CK_MSG_REGEXP, + "^Assertion '\\(2%s\\)\\*x is not NaN' failed: \\(2%s\\)\\*x == -?nan$" }, #else { "Simple Tests", "test_ck_assert_double_nonnan", CK_PASS, CK_MSG_TEXT, "Passed" }, { "Simple Tests", "test_ck_assert_double_nonnan_with_mod", CK_PASS, CK_MSG_TEXT, "Passed" }, @@ -199,86 +288,161 @@ static master_test_t master_tests[] = { { "Simple Tests", "test_ck_assert_double_nan_and_inf_with_expr", CK_PASS, CK_MSG_TEXT, "Passed" }, /* End of tests on double macros */ /* Tests on long double macros */ - { "Simple Tests", "test_ck_assert_ldouble_eq", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x == y' failed: x == 1.1, y == 1.2" }, - { "Simple Tests", "test_ck_assert_ldouble_eq_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d == 2%f' failed: 3%d == 1, 2%f == 0" }, + { "Simple Tests", "test_ck_assert_ldouble_eq", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x == y' failed: x == 1.1, y == 1.2" }, + { "Simple Tests", "test_ck_assert_ldouble_eq_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d == 2%f' failed: 3%d == 1, 2%f == 0" }, { "Simple Tests", "test_ck_assert_ldouble_eq_with_promotion", CK_PASS, CK_MSG_TEXT, "Passed" }, - { "Simple Tests", "test_ck_assert_ldouble_eq_with_conv", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x == 1.1' failed: x == 1.1, 1.1 == 1.1" }, - { "Simple Tests", "test_ck_assert_ldouble_ne", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x != y' failed: x == 1.1, y == 1.1" }, - { "Simple Tests", "test_ck_assert_ldouble_ne_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '1%d != 1%f' failed: 1%d == 1, 1%f == 1" }, - { "Simple Tests", "test_ck_assert_ldouble_lt", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x < y' failed: x == 2, y == 1.5" }, - { "Simple Tests", "test_ck_assert_ldouble_lt_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d < 2%f' failed: 3%d == 1, 2%f == 0" }, - { "Simple Tests", "test_ck_assert_ldouble_le", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x <= y' failed: x == 2, y == 1.5" }, - { "Simple Tests", "test_ck_assert_ldouble_le_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d <= 2%f' failed: 3%d == 1, 2%f == 0" }, - { "Simple Tests", "test_ck_assert_ldouble_gt", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x > y' failed: x == 2.5, y == 3" }, - { "Simple Tests", "test_ck_assert_ldouble_gt_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d > 3%f' failed: 2%d == 0, 3%f == 1" }, - { "Simple Tests", "test_ck_assert_ldouble_ge", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x >= y' failed: x == 2.5, y == 3" }, - { "Simple Tests", "test_ck_assert_ldouble_ge_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d >= 3%f' failed: 2%d == 0, 3%f == 1" }, - { "Simple Tests", "test_ck_assert_ldouble_with_expr", CK_PASS, CK_MSG_TEXT, "Passed" }, - { "Simple Tests", "test_ck_assert_ldouble_eq_tol", CK_FAILURE, CK_MSG_TEXT, "Assertion 'fabsl(y - x) < t' failed: x == 0.001, y == 0.002, t == 0.001" }, - { "Simple Tests", "test_ck_assert_ldouble_eq_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion 'fabsl(2%f - 3%d) < 2%p' failed: 3%d == 1, 2%f == 0, 2%p == 0" }, - { "Simple Tests", "test_ck_assert_ldouble_ne_tol", CK_FAILURE, CK_MSG_TEXT, "Assertion 'fabsl(y - x) >= t' failed: x == 0.001, y == 0.002, t == 0.01" }, - { "Simple Tests", "test_ck_assert_ldouble_ne_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion 'fabsl(3%f - 3%d) >= 3%p' failed: 3%d == 1, 3%f == 1, 3%p == 1" }, - { "Simple Tests", "test_ck_assert_ldouble_ge_tol", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x >= y, error < t' failed: x == 0.01, y == 0.03, t == 0.01" }, - { "Simple Tests", "test_ck_assert_ldouble_ge_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d >= 3%f, error < 3%p' failed: 2%d == 0, 3%f == 1, 3%p == 1" }, - { "Simple Tests", "test_ck_assert_ldouble_le_tol", CK_FAILURE, CK_MSG_TEXT, "Assertion 'y <= x, error < t' failed: y == 0.03, x == 0.01, t == 0.01" }, - { "Simple Tests", "test_ck_assert_ldouble_le_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '3%d <= 2%f, error < 3%p' failed: 3%d == 1, 2%f == 0, 3%p == 1" }, - { "Simple Tests", "test_ck_assert_ldouble_tol_with_expr", CK_PASS, CK_MSG_TEXT, "Passed" }, - { "Simple Tests", "test_ck_assert_ldouble_finite", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x is finite' failed: x == inf" }, - { "Simple Tests", "test_ck_assert_ldouble_finite_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x*(1%d) is finite' failed: x*(1%d) == inf" }, - { "Simple Tests", "test_ck_assert_ldouble_infinite", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x is infinite' failed: x == 0" }, - { "Simple Tests", "test_ck_assert_ldouble_infinite_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d is infinite' failed: 2%d == 0" }, - { "Simple Tests", "test_ck_assert_ldouble_nan", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x is NaN' failed: x == inf" }, - { "Simple Tests", "test_ck_assert_ldouble_nan_with_mod", CK_FAILURE, CK_MSG_TEXT, "Assertion '2%d is NaN' failed: 2%d == 0" }, + { "Simple Tests", "test_ck_assert_ldouble_eq_with_conv", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x == 1.1' failed: x == 1.1, 1.1 == 1.1" }, + { "Simple Tests", "test_ck_assert_ldouble_ne", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x != y' failed: x == 1.1, y == 1.1" }, + { "Simple Tests", "test_ck_assert_ldouble_ne_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '1%d != 1%f' failed: 1%d == 1, 1%f == 1" }, + { "Simple Tests", "test_ck_assert_ldouble_lt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x < y' failed: x == 2, y == 1.5" }, + { "Simple Tests", "test_ck_assert_ldouble_lt_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d < 2%f' failed: 3%d == 1, 2%f == 0" }, + { "Simple Tests", "test_ck_assert_ldouble_le", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x <= y' failed: x == 2, y == 1.5" }, + { "Simple Tests", "test_ck_assert_ldouble_le_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d <= 2%f' failed: 3%d == 1, 2%f == 0" }, + { "Simple Tests", "test_ck_assert_ldouble_gt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x > y' failed: x == 2.5, y == 3" }, + { "Simple Tests", "test_ck_assert_ldouble_gt_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d > 3%f' failed: 2%d == 0, 3%f == 1" }, + { "Simple Tests", "test_ck_assert_ldouble_ge", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x >= y' failed: x == 2.5, y == 3" }, + { "Simple Tests", "test_ck_assert_ldouble_ge_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d >= 3%f' failed: 2%d == 0, 3%f == 1" }, + { "Simple Tests", "test_ck_assert_ldouble_with_expr", CK_PASS, CK_MSG_TEXT, + "Passed" }, + { "Simple Tests", "test_ck_assert_ldouble_eq_tol", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'fabsl(y - x) < t' failed: x == 0.001, y == 0.002, t == 0.001" }, + { "Simple Tests", "test_ck_assert_ldouble_eq_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'fabsl(2%f - 3%d) < 2%p' failed: 3%d == 1, 2%f == 0, 2%p == 0" }, + { "Simple Tests", "test_ck_assert_ldouble_ne_tol", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'fabsl(y - x) >= t' failed: x == 0.001, y == 0.002, t == 0.01" }, + { "Simple Tests", "test_ck_assert_ldouble_ne_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'fabsl(3%f - 3%d) >= 3%p' failed: 3%d == 1, 3%f == 1, 3%p == 1" }, + { "Simple Tests", "test_ck_assert_ldouble_ge_tol", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x >= y, error < t' failed: x == 0.01, y == 0.03, t == 0.01" }, + { "Simple Tests", "test_ck_assert_ldouble_ge_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d >= 3%f, error < 3%p' failed: 2%d == 0, 3%f == 1, 3%p == 1" }, + { "Simple Tests", "test_ck_assert_ldouble_le_tol", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'y <= x, error < t' failed: y == 0.03, x == 0.01, t == 0.01" }, + { "Simple Tests", "test_ck_assert_ldouble_le_tol_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '3%d <= 2%f, error < 3%p' failed: 3%d == 1, 2%f == 0, 3%p == 1" }, + { "Simple Tests", "test_ck_assert_ldouble_tol_with_expr", CK_PASS, CK_MSG_TEXT, + "Passed" }, + { "Simple Tests", "test_ck_assert_ldouble_finite", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x is finite' failed: x == inf" }, + { "Simple Tests", "test_ck_assert_ldouble_finite_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x*(1%d) is finite' failed: x*(1%d) == inf" }, + { "Simple Tests", "test_ck_assert_ldouble_infinite", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x is infinite' failed: x == 0" }, + { "Simple Tests", "test_ck_assert_ldouble_infinite_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d is infinite' failed: 2%d == 0" }, + { "Simple Tests", "test_ck_assert_ldouble_nan", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x is NaN' failed: x == inf" }, + { "Simple Tests", "test_ck_assert_ldouble_nan_with_mod", CK_FAILURE, CK_MSG_TEXT, + "Assertion '2%d is NaN' failed: 2%d == 0" }, #if ENABLE_REGEX - { "Simple Tests", "test_ck_assert_ldouble_nonnan", CK_FAILURE, CK_MSG_REGEXP, "^Assertion 'x is not NaN' failed: x == -?nan$" }, - { "Simple Tests", "test_ck_assert_ldouble_nonnan_with_mod", CK_FAILURE, CK_MSG_REGEXP, "^Assertion '\\(2%s\\)\\*x is not NaN' failed: \\(2%s\\)\\*x == -?nan$" }, + { "Simple Tests", "test_ck_assert_ldouble_nonnan", CK_FAILURE, CK_MSG_REGEXP, + "^Assertion 'x is not NaN' failed: x == -?nan$" }, + { "Simple Tests", "test_ck_assert_ldouble_nonnan_with_mod", CK_FAILURE, CK_MSG_REGEXP, + "^Assertion '\\(2%s\\)\\*x is not NaN' failed: \\(2%s\\)\\*x == -?nan$" }, #else { "Simple Tests", "test_ck_assert_ldouble_nonnan", CK_PASS, CK_MSG_TEXT, "Passed" }, { "Simple Tests", "test_ck_assert_ldouble_nonnan_with_mod", CK_PASS, CK_MSG_TEXT, "Passed" }, #endif - { "Simple Tests", "test_ck_assert_ldouble_nan_and_inf_with_expr", CK_PASS, CK_MSG_TEXT, "Passed" }, + { "Simple Tests", "test_ck_assert_ldouble_nan_and_inf_with_expr", CK_PASS, CK_MSG_TEXT, + "Passed" }, /* End of tests on long double macros */ - { "Simple Tests", "test_percent_n_escaped", CK_FAILURE, CK_MSG_TEXT, "Assertion 'returnsZero(\"%n\") == 1' failed: returnsZero(\"%n\") == 0, 1 == 1" }, - { "Simple Tests", "test_ck_assert_str_eq", CK_FAILURE, CK_MSG_TEXT, "Assertion '\"test1\" == s' failed: \"test1\" == \"test1\", s == \"test2\"" }, - { "Simple Tests", "test_ck_assert_str_eq_with_null", CK_FAILURE, CK_MSG_TEXT, "Assertion 't == s' failed: t == (null), s == (null)" }, - { "Simple Tests", "test_ck_assert_str_ne", CK_FAILURE, CK_MSG_TEXT, "Assertion 't != s' failed: t == \"test2\", s == \"test2\"" }, - { "Simple Tests", "test_ck_assert_str_ne_with_null", CK_FAILURE, CK_MSG_TEXT, "Assertion 't != s' failed: t == \"test\", s == (null)" }, - { "Simple Tests", "test_ck_assert_str_lt", CK_FAILURE, CK_MSG_TEXT, "Assertion 's < s' failed: s == \"test1\", s == \"test1\"" }, - { "Simple Tests", "test_ck_assert_str_lt_with_null", CK_FAILURE, CK_MSG_TEXT, "Assertion 's < t' failed: s == (null), t == \"test\"" }, - { "Simple Tests", "test_ck_assert_str_le", CK_FAILURE, CK_MSG_TEXT, "Assertion 't <= s' failed: t == \"test2\", s == \"test1\"" }, - { "Simple Tests", "test_ck_assert_str_le_with_null", CK_FAILURE, CK_MSG_TEXT, "Assertion 't <= s' failed: t == (null), s == (null)" }, - { "Simple Tests", "test_ck_assert_str_gt", CK_FAILURE, CK_MSG_TEXT, "Assertion 't > t' failed: t == \"test2\", t == \"test2\"" }, - { "Simple Tests", "test_ck_assert_str_gt_with_null", CK_FAILURE, CK_MSG_TEXT, "Assertion 't > s' failed: t == \"test\", s == (null)" }, - { "Simple Tests", "test_ck_assert_str_ge", CK_FAILURE, CK_MSG_TEXT, "Assertion 's >= t' failed: s == \"test1\", t == \"test2\"" }, - { "Simple Tests", "test_ck_assert_str_ge_with_null", CK_FAILURE, CK_MSG_TEXT, "Assertion 's >= t' failed: s == (null), t == (null)" }, - { "Simple Tests", "test_ck_assert_str_expr", CK_PASS, CK_MSG_TEXT, "Passed" }, - { "Simple Tests", "test_ck_assert_pstr_eq", CK_FAILURE, CK_MSG_TEXT, "Assertion '\"test1\" == s' failed: \"test1\" == \"test1\", s == \"test\"" }, - { "Simple Tests", "test_ck_assert_pstr_eq_with_null", CK_FAILURE, CK_MSG_TEXT, "Assertion 't == s' failed: t == \"test\", s == (null)" }, - { "Simple Tests", "test_ck_assert_pstr_ne", CK_FAILURE, CK_MSG_TEXT, "Assertion 't != s' failed: t == \"test2\", s == \"test2\"" }, - { "Simple Tests", "test_ck_assert_pstr_ne_with_null", CK_FAILURE, CK_MSG_TEXT, "Assertion 't != s' failed: t == (null), s == (null)" }, - { "Simple Tests", "test_ck_assert_ptr_eq", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x == y' failed: x == 0x1, y == 0x2" }, - { "Simple Tests", "test_ck_assert_ptr_ne", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x != z' failed: x == 0x1, z == 0x1" }, - { "Simple Tests", "test_ck_assert_ptr_null", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x == NULL' failed: x == 0x1" }, - { "Simple Tests", "test_ck_assert_ptr_nonnull", CK_FAILURE, CK_MSG_TEXT, "Assertion 'x != NULL' failed: x == 0" }, - { "Simple Tests", "test_ck_assert_mem_eq", CK_FAILURE, CK_MSG_TEXT, "Assertion '\"\\x00\\x00\\x00\\x00\\x01\" == s' failed: \"\\x00\\x00\\x00\\x00\\x01\" == \"0000000001\", s == \"0000000002\"" }, - { "Simple Tests", "test_ck_assert_mem_ne", CK_FAILURE, CK_MSG_TEXT, "Assertion 't != s' failed: t == \"0000000002\", s == \"0000000002\"" }, - { "Simple Tests", "test_ck_assert_mem_lt", CK_FAILURE, CK_MSG_TEXT, "Assertion 's < s' failed: s == \"0000000001\", s == \"0000000001\"" }, - { "Simple Tests", "test_ck_assert_mem_le", CK_FAILURE, CK_MSG_TEXT, "Assertion 't <= s' failed: t == \"0000000002\", s == \"0000000001\"" }, - { "Simple Tests", "test_ck_assert_mem_gt", CK_FAILURE, CK_MSG_TEXT, "Assertion 't > t' failed: t == \"0000000002\", t == \"0000000002\"" }, - { "Simple Tests", "test_ck_assert_mem_ge", CK_FAILURE, CK_MSG_TEXT, "Assertion 's >= t' failed: s == \"0000000001\", t == \"0000000002\"" }, - { "Simple Tests", "test_ck_assert_mem_zerolen", CK_PASS, CK_MSG_TEXT, "Passed" }, - { "Simple Tests", "test_ck_assert_mem_eq_exact", CK_FAILURE, CK_MSG_TEXT, "Assertion 't == s' failed: t == \"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001\", s == \"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002\"" }, - { "Simple Tests", "test_ck_assert_mem_eq_longer", CK_FAILURE, CK_MSG_TEXT, "Assertion 't == s' failed: t == \"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000..\", s == \"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000..\"" }, + { "Simple Tests", "test_percent_n_escaped", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'returnsZero(\"%n\") == 1' failed: " + "returnsZero(\"%n\") == 0, 1 == 1" }, + { "Simple Tests", "test_ck_assert_str_eq", CK_FAILURE, CK_MSG_TEXT, + "Assertion '\"test1\" == s' failed: \"test1\" == \"test1\", s == \"test2\"" }, + { "Simple Tests", "test_ck_assert_str_eq_with_null", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't == s' failed: t == (null), s == (null)" }, + { "Simple Tests", "test_ck_assert_str_ne", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't != s' failed: t == \"test2\", s == \"test2\"" }, + { "Simple Tests", "test_ck_assert_str_ne_with_null", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't != s' failed: t == \"test\", s == (null)" }, + { "Simple Tests", "test_ck_assert_str_lt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 's < s' failed: s == \"test1\", s == \"test1\"" }, + { "Simple Tests", "test_ck_assert_str_lt_with_null", CK_FAILURE, CK_MSG_TEXT, + "Assertion 's < t' failed: s == (null), t == \"test\"" }, + { "Simple Tests", "test_ck_assert_str_le", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't <= s' failed: t == \"test2\", s == \"test1\"" }, + { "Simple Tests", "test_ck_assert_str_le_with_null", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't <= s' failed: t == (null), s == (null)" }, + { "Simple Tests", "test_ck_assert_str_gt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't > t' failed: t == \"test2\", t == \"test2\"" }, + { "Simple Tests", "test_ck_assert_str_gt_with_null", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't > s' failed: t == \"test\", s == (null)" }, + { "Simple Tests", "test_ck_assert_str_ge", CK_FAILURE, CK_MSG_TEXT, + "Assertion 's >= t' failed: s == \"test1\", t == \"test2\"" }, + { "Simple Tests", "test_ck_assert_str_ge_with_null", CK_FAILURE, CK_MSG_TEXT, + "Assertion 's >= t' failed: s == (null), t == (null)" }, + { "Simple Tests", "test_ck_assert_str_expr", CK_PASS, CK_MSG_TEXT, + "Passed" }, + { "Simple Tests", "test_ck_assert_pstr_eq", CK_FAILURE, CK_MSG_TEXT, + "Assertion '\"test1\" == s' failed: \"test1\" == \"test1\", s == \"test\"" }, + { "Simple Tests", "test_ck_assert_pstr_eq_with_null", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't == s' failed: t == \"test\", s == (null)" }, + { "Simple Tests", "test_ck_assert_pstr_ne", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't != s' failed: t == \"test2\", s == \"test2\"" }, + { "Simple Tests", "test_ck_assert_pstr_ne_with_null", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't != s' failed: t == (null), s == (null)" }, + { "Simple Tests", "test_ck_assert_ptr_eq", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x == y' failed: x == 0x1, y == 0x2" }, + { "Simple Tests", "test_ck_assert_ptr_ne", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x != z' failed: x == 0x1, z == 0x1" }, + { "Simple Tests", "test_ck_assert_ptr_null", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x == NULL' failed: x == 0x1" }, + { "Simple Tests", "test_ck_assert_ptr_nonnull", CK_FAILURE, CK_MSG_TEXT, + "Assertion 'x != NULL' failed: x == 0" }, + { "Simple Tests", "test_ck_assert_mem_eq", CK_FAILURE, CK_MSG_TEXT, + "Assertion '\"\\x00\\x00\\x00\\x00\\x01\" == s' failed: " + "\"\\x00\\x00\\x00\\x00\\x01\" == \"0000000001\", s == \"0000000002\"" }, + { "Simple Tests", "test_ck_assert_mem_ne", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't != s' failed: t == \"0000000002\", s == \"0000000002\"" }, + { "Simple Tests", "test_ck_assert_mem_lt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 's < s' failed: s == \"0000000001\", s == \"0000000001\"" }, + { "Simple Tests", "test_ck_assert_mem_le", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't <= s' failed: t == \"0000000002\", s == \"0000000001\"" }, + { "Simple Tests", "test_ck_assert_mem_gt", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't > t' failed: t == \"0000000002\", t == \"0000000002\"" }, + { "Simple Tests", "test_ck_assert_mem_ge", CK_FAILURE, CK_MSG_TEXT, + "Assertion 's >= t' failed: s == \"0000000001\", t == \"0000000002\"" }, + { "Simple Tests", "test_ck_assert_mem_zerolen", CK_PASS, CK_MSG_TEXT, + "Passed" }, + { "Simple Tests", "test_ck_assert_mem_eq_exact", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't == s' failed: " + "t == \"0000000000000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000001\", " + "s == \"0000000000000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000002\"" }, + { "Simple Tests", "test_ck_assert_mem_eq_longer", CK_FAILURE, CK_MSG_TEXT, + "Assertion 't == s' failed: " + "t == \"0000000000000000000000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000000000000000000000000..\", " + "s == \"0000000000000000000000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000000000000000000000000..\"" }, #if defined(HAVE_FORK) && HAVE_FORK==1 { "Signal Tests", "test_segv", CK_ERROR, CK_MSG_TEXT, signal_11_str }, { "Signal Tests", "test_segv_pass", CK_PASS, CK_MSG_TEXT, "Passed" }, { "Signal Tests", "test_segv", CK_ERROR, CK_MSG_TEXT, signal_11_8_str }, - { "Signal Tests", "test_non_signal_8", CK_FAILURE, CK_MSG_TEXT, "Early exit with return value 0" }, - { "Signal Tests", "test_fail_unless", CK_FAILURE, CK_MSG_TEXT, "Early exit with return value 1" }, + { "Signal Tests", "test_non_signal_8", CK_FAILURE, CK_MSG_TEXT, + "Early exit with return value 0" }, + { "Signal Tests", "test_fail_unless", CK_FAILURE, CK_MSG_TEXT, + "Early exit with return value 1" }, #if !defined(__CYGWIN__) - { "Signal Tests", "test_fpe", CK_ERROR, CK_MSG_TEXT, signal_8_str }, - { "Signal Tests", "test_mark_point", CK_ERROR, CK_MSG_TEXT, signal_8_str }, + { "Signal Tests", "test_fpe", CK_ERROR, CK_MSG_TEXT, signal_8_str }, + { "Signal Tests", "test_mark_point", CK_ERROR, CK_MSG_TEXT, signal_8_str }, #endif /* !defined(__CYGWIN__) */ #endif /* HAVE_FORK */ @@ -343,16 +507,19 @@ static master_test_t master_tests[] = { { "Environment Double Timeout Scaling Tests", "test_sleep9_fail", CK_ERROR, CK_MSG_TEXT, "Test timeout expired" }, { "Environment Double Timeout Scaling Tests", "test_sleep14_fail", CK_ERROR, CK_MSG_TEXT, "Test timeout expired" }, - { "Timeout Integer Scaling Tests", "test_eternal_fail", CK_ERROR, CK_MSG_TEXT, "Test timeout expired" }, + { "Timeout Integer Scaling Tests", "test_eternal_fail", CK_ERROR, CK_MSG_TEXT, + "Test timeout expired" }, #ifdef HAVE_LIBRT { "Timeout Integer Scaling Tests", "test_sleep0_025_pass", CK_PASS, CK_MSG_TEXT, "Passed" }, { "Timeout Integer Scaling Tests", "test_sleep1_pass", CK_PASS, CK_MSG_TEXT, "Passed" }, { "Timeout Integer Scaling Tests", "test_sleep2_pass", CK_PASS, CK_MSG_TEXT, "Passed" }, #endif /* HAVE_LIBRT */ { "Timeout Integer Scaling Tests", "test_sleep5_pass", CK_PASS, CK_MSG_TEXT, "Passed" }, - { "Timeout Integer Scaling Tests", "test_sleep9_fail", CK_ERROR, CK_MSG_TEXT, "Test timeout expired" }, + { "Timeout Integer Scaling Tests", "test_sleep9_fail", CK_ERROR, CK_MSG_TEXT, + "Test timeout expired" }, - { "Timeout Double Scaling Tests", "test_eternal_fail", CK_ERROR, CK_MSG_TEXT, "Test timeout expired" }, + { "Timeout Double Scaling Tests", "test_eternal_fail", CK_ERROR, CK_MSG_TEXT, + "Test timeout expired" }, #ifdef HAVE_LIBRT { "Timeout Double Scaling Tests", "test_sleep0_025_pass", CK_PASS, CK_MSG_TEXT, "Passed" }, { "Timeout Double Scaling Tests", "test_sleep1_pass", CK_PASS, CK_MSG_TEXT, "Passed" }, @@ -432,7 +599,8 @@ END_TEST START_TEST(test_check_ntests_run) { ck_assert_msg (sub_ntests == nr_of_master_tests, - "Unexpected number of tests run %d vs expected %d", sub_ntests, nr_of_master_tests); + "Unexpected number of tests run %d vs expected %d", + sub_ntests, nr_of_master_tests); } END_TEST @@ -583,8 +751,9 @@ START_TEST(test_check_failure_lnos) } if (line_no > 0 && tr_lno(tr) != line_no) { - ck_abort_msg("For test %d (failure %d): Expected lno %d, got %d for suite %s, msg %s", - i, failed, line_no, tr_lno(tr), tr_tcname(tr), tr_msg(tr)); + ck_abort_msg("For test %d (failure %d): " + "Expected lno %d, got %d for suite %s, msg %s", + i, failed, line_no, tr_lno(tr), tr_tcname(tr), tr_msg(tr)); } } @@ -611,8 +780,8 @@ START_TEST(test_check_failure_ftypes) tr = tr_fail_array[i - passed]; ck_assert_msg(tr != NULL, NULL); ck_assert_msg(master_tests[i].failure_type == tr_rtype(tr), - "Failure type wrong for test %d:%s:%s", - i, master_tests[i].tcname, master_tests[i].test_name); + "Failure type wrong for test %d:%s:%s", + i, master_tests[i].tcname, master_tests[i].test_name); } } END_TEST @@ -625,8 +794,8 @@ START_TEST(test_check_failure_lfiles) ck_assert_msg(tr != NULL, NULL); ck_assert_msg(tr_lfile(tr) != NULL, "Bad file name for test %d", i); ck_assert_msg(strstr(tr_lfile(tr), "check_check_sub.c") != 0, - "Bad file name for test %d:%s:%s", - i, master_tests[i].tcname, master_tests[i].test_name); + "Bad file name for test %d:%s:%s", + i, master_tests[i].tcname, master_tests[i].test_name); } } END_TEST @@ -949,14 +1118,15 @@ void record_failure_line_num(int linenum) * If the master suite runs and does not find line numbers it will * fail as expected. */ - fprintf(stderr, "Line number file not setup, not reporting test failure line: %s", string); + fprintf(stderr, "Line number file not setup, not reporting test failure line: %s", string); return; } written = fwrite(string, 1, to_write, line_num_failures); if(written != to_write) { - fprintf(stderr, "%s:%d: Error in call to fwrite, wrote %ld instead of %d:", __FILE__, __LINE__, written, to_write); + fprintf(stderr, "%s:%d: Error in call to fwrite, wrote %ld instead of %d:", + __FILE__, __LINE__, written, to_write); exit(1); } diff --git a/tests/check_check_sub.c b/tests/check_check_sub.c index 7ac072a9..5d8c722c 100644 --- a/tests/check_check_sub.c +++ b/tests/check_check_sub.c @@ -2261,8 +2261,16 @@ END_TEST START_TEST(test_ck_assert_mem_eq_exact) { - const char *s = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02"; - const char *t = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"; + const char *s = + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02"; + const char *t = + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"; record_test_name(tcase_name()); record_failure_line_num(__LINE__); ck_assert_mem_eq(t, s, 64); @@ -2271,8 +2279,16 @@ END_TEST START_TEST(test_ck_assert_mem_eq_longer) { - const char *s = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02"; - const char *t = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"; + const char *s = + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02"; + const char *t = + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"; record_test_name(tcase_name()); record_failure_line_num(__LINE__); ck_assert_mem_eq(t, s, 65); diff --git a/tests/check_mem_leaks.c b/tests/check_mem_leaks.c index 4528fb06..b8f39977 100644 --- a/tests/check_mem_leaks.c +++ b/tests/check_mem_leaks.c @@ -87,4 +87,3 @@ int main () srunner_free(sr); return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } -