2016-01-18 18:53:26 +00:00
|
|
|
#ifndef TEST_CATCH_EXT_HPP
|
|
|
|
#define TEST_CATCH_EXT_HPP
|
|
|
|
|
|
|
|
#include "catch.hpp"
|
|
|
|
|
2022-08-11 20:54:50 +00:00
|
|
|
#define TRY_CHECK(expr) \
|
|
|
|
try \
|
|
|
|
{ \
|
|
|
|
CHECK(expr); \
|
2022-11-10 15:57:38 +00:00
|
|
|
} \
|
|
|
|
catch (Catch::TestFailureException&) \
|
2022-08-11 20:54:50 +00:00
|
|
|
{ \
|
|
|
|
/* thrown by CHECK after it catches and reports */ \
|
|
|
|
/* an exception from expr => swallow this */ \
|
2016-01-18 18:53:26 +00:00
|
|
|
}
|
|
|
|
|
2022-08-11 20:54:50 +00:00
|
|
|
#define TRY_CHECK_FALSE(expr) \
|
|
|
|
try \
|
|
|
|
{ \
|
|
|
|
CHECK_FALSE(expr); \
|
2022-11-10 15:57:38 +00:00
|
|
|
} \
|
|
|
|
catch (Catch::TestFailureException&) \
|
2022-08-11 20:54:50 +00:00
|
|
|
{}
|
2016-01-18 18:53:26 +00:00
|
|
|
|
|
|
|
#endif // TEST_CATCH_EXT_HPP
|