Commit 602837e0 authored by Matthias Vallentin's avatar Matthias Vallentin

Let CAF_FAIL cause an unconditional failure

The macro CAF_REQUIRE and CAF_FAIL now both terminate test execution.
The only difference between the two is that CAF_REQUIRE takes a
condition and CAF_FAIL a termination erro message. This behavior is
similar to Boost.Test.

Resolves #330.
parent f864dfd9
......@@ -563,13 +563,10 @@ using caf_test_case_auto_fixture = caf::test::dummy_fixture;
::caf::test::engine::last_check_line(__LINE__); \
} while(false)
#define CAF_FAIL(...) \
#define CAF_FAIL(msg) \
do { \
(void)(::caf::test::detail::expr{ \
::caf::test::engine::current_test(), __FILE__, __LINE__, \
true, #__VA_ARGS__} ->* __VA_ARGS__); \
::caf::test::engine::last_check_file(__FILE__); \
::caf::test::engine::last_check_line(__LINE__); \
CAF_TEST_ERROR(msg); \
throw ::caf::test::detail::require_error{"test failure"}; \
} while(false)
#define CAF_REQUIRE(...) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment