mapnik/test/catch_ext.hpp

24 lines
1.7 KiB
C++
Raw 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&) \
{ \
/* 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&) \
{}
#endif // TEST_CATCH_EXT_HPP