mapnik/test/catch_ext.hpp

26 lines
1.9 KiB
C++
Raw Permalink Normal View History

#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&) \
2022-08-11 22:54:50 +02:00
{ \
/* thrown by CHECK after it catches and reports */ \
/* an exception from expr => swallow this */ \
}
2022-08-11 22:54:50 +02:00
#define TRY_CHECK_FALSE(expr) \
try \
{ \
CHECK_FALSE(expr); \
} \
catch (Catch::TestFailureException&) \
2022-08-11 22:54:50 +02:00
{}
#endif // TEST_CATCH_EXT_HPP