diff --git a/include/criterion/redirect.h b/include/criterion/redirect.h index e037691..b8a80c5 100644 --- a/include/criterion/redirect.h +++ b/include/criterion/redirect.h @@ -73,11 +73,11 @@ CR_END_C_API CR_VA_TAIL(CR_VA_TAIL(__VA_ARGS__)) \ )) -# define cr_assert_file_contents_match_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_ABORT_, cr_file_match_str, ==, __VA_ARGS__)) -# define cr_expect_file_contents_match_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_CONTINUES_, cr_file_match_str, ==, __VA_ARGS__)) +# define cr_assert_file_contents_eq_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_ABORT_, cr_file_match_str, ==, __VA_ARGS__)) +# define cr_expect_file_contents_eq_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_CONTINUES_, cr_file_match_str, ==, __VA_ARGS__)) -# define cr_assert_file_contents_not_match_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_ABORT_, cr_file_match_str, !=, __VA_ARGS__)) -# define cr_expect_file_contents_not_match_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_CONTINUES_, cr_file_match_str, !=, __VA_ARGS__)) +# define cr_assert_file_contents_neq_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_ABORT_, cr_file_match_str, !=, __VA_ARGS__)) +# define cr_expect_file_contents_neq_str(...) CR_EXPAND(cr_assert_redir_op_va_(CR_FAIL_CONTINUES_, cr_file_match_str, !=, __VA_ARGS__)) # ifdef __cplusplus namespace criterion { diff --git a/samples/redirect.c b/samples/redirect.c index 895eb56..f7ee089 100644 --- a/samples/redirect.c +++ b/samples/redirect.c @@ -17,14 +17,14 @@ Test(redirect, test_outputs, .init = redirect_all_std) { fprintf(stdout, "foo"); fflush(stdout); - cr_assert_file_contents_match_str(f_stdout, "foo"); + cr_assert_file_contents_eq_str(f_stdout, "foo"); FILE* f_stderr = cr_get_redirected_stderr(); fprintf(stderr, "bar"); fflush(stderr); - cr_assert_file_contents_match_str(f_stderr, "bar"); + cr_assert_file_contents_eq_str(f_stderr, "bar"); } // Testing general I/O with sample command-line rot13 @@ -53,5 +53,5 @@ Test(redirect, rot13, .init = cr_redirect_stdout) { rot13_io(); FILE* f_stdout = cr_get_redirected_stdout(); - cr_assert_file_contents_match_str(f_stdout, "gur dhvpx oebja sbk whzcf bire gur ynml qbt"); + cr_assert_file_contents_eq_str(f_stdout, "gur dhvpx oebja sbk whzcf bire gur ynml qbt"); } diff --git a/samples/redirect.cc b/samples/redirect.cc index 29ee036..f87dfb8 100644 --- a/samples/redirect.cc +++ b/samples/redirect.cc @@ -22,10 +22,10 @@ Test(redirect, test_outputs, .init = redirect_all_std) { std::cerr << "bar" << std::flush; std::FILE* f_stdout = cr_get_redirected_stdout(); - cr_assert_file_contents_match_str(f_stdout, "foo"); + cr_assert_file_contents_eq_str(f_stdout, "foo"); std::FILE* f_stderr = cr_get_redirected_stderr(); - cr_assert_file_contents_match_str(f_stderr, "bar"); + cr_assert_file_contents_eq_str(f_stderr, "bar"); } // Testing general I/O with sample command-line rot13 @@ -52,5 +52,5 @@ Test(redirect, rot13, .init = cr_redirect_stdout) { rot13_io(); std::FILE* f_stdout = cr_get_redirected_stdout(); - cr_assert_file_contents_match_str(f_stdout, "gur dhvpx oebja sbk whzcf bire gur ynml qbt"); + cr_assert_file_contents_eq_str(f_stdout, "gur dhvpx oebja sbk whzcf bire gur ynml qbt"); }