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