forked from premiere/premiere-libtorrent
catch exceptions from TEST_CHECK
This commit is contained in:
parent
52f7bbc185
commit
6b379c7137
|
@ -52,8 +52,19 @@ void report_failure(char const* str, char const* file, int line);
|
|||
report_failure(x, line, file)
|
||||
|
||||
#define TEST_CHECK(x) \
|
||||
if (!(x)) \
|
||||
TEST_REPORT_AUX("TEST_CHECK failed: \"" #x "\"", __FILE__, __LINE__)
|
||||
try \
|
||||
{ \
|
||||
if (!(x)) \
|
||||
TEST_REPORT_AUX("TEST_CHECK failed: \"" #x "\"", __FILE__, __LINE__); \
|
||||
} \
|
||||
catch (std::exception& e) \
|
||||
{ \
|
||||
TEST_ERROR("Exception thrown: " #x " :" + std::string(e.what())); \
|
||||
} \
|
||||
catch (...) \
|
||||
{ \
|
||||
TEST_ERROR("Exception thrown: " #x); \
|
||||
}
|
||||
|
||||
#define TEST_ERROR(x) \
|
||||
TEST_REPORT_AUX((std::string("ERROR: \"") + x + "\"").c_str(), __FILE__, __LINE__)
|
||||
|
|
Loading…
Reference in New Issue