tap: protect against exceptions in func eval expect

This commit is contained in:
Danny Robson 2016-07-28 13:44:17 +10:00
parent f793175fdf
commit ed7c466d8d

View File

@ -47,7 +47,11 @@ template <typename... Args>
void void
util::TAP::logger::expect (const std::function<bool(Args...)> &test, Args&&... args, const std::string &msg) util::TAP::logger::expect (const std::function<bool(Args...)> &test, Args&&... args, const std::string &msg)
{ {
try {
expect (test (std::forward<Args> (args)...), msg); expect (test (std::forward<Args> (args)...), msg);
} catch (...) {
expect (false, msg);
}
} }