bool handled = false;
auto expect_runtime_error_yes_catch_all = [&](const exception_wrapper& ew) {
ew.handle(
- [](const std::logic_error&) { EXPECT_TRUE(false); },
+ [](const std::logic_error&) { ADD_FAILURE(); },
[&](const std::runtime_error&) { handled = true; },
- [](const std::exception&) { EXPECT_TRUE(false); },
- [](...) { EXPECT_TRUE(false); });
+ [](const std::exception&) { ADD_FAILURE(); },
+ [](...) { ADD_FAILURE(); });
};
expect_runtime_error_yes_catch_all(ew_eptr);
auto expect_runtime_error_no_catch_all = [&](const exception_wrapper& ew) {
ew.handle(
- [](const std::logic_error&) { EXPECT_TRUE(false); },
+ [](const std::logic_error&) { ADD_FAILURE(); },
[&](const std::runtime_error&) { handled = true; },
- [](const std::exception&) { EXPECT_TRUE(false); });
+ [](const std::exception&) { ADD_FAILURE(); });
};
expect_runtime_error_no_catch_all(ew_eptr);
auto expect_runtime_error_catch_non_std = [&](const exception_wrapper& ew) {
ew.handle(
- [](const std::logic_error&) { EXPECT_TRUE(false); },
+ [](const std::logic_error&) { ADD_FAILURE(); },
[&](const std::runtime_error&) { handled = true; },
- [](const std::exception&) { EXPECT_TRUE(false); },
- [](const int&) { EXPECT_TRUE(false); });
+ [](const std::exception&) { ADD_FAILURE(); },
+ [](const int&) { ADD_FAILURE(); });
};
expect_runtime_error_catch_non_std(ew_eptr);
// outer handler:
auto expect_runtime_error_rethrow = [&](const exception_wrapper& ew) {
ew.handle(
- [](const std::logic_error&) { EXPECT_TRUE(false); },
+ [](const std::logic_error&) { ADD_FAILURE(); },
[&](const std::runtime_error& e) {
handled = true;
throw e;
},
- [](const std::exception&) { EXPECT_TRUE(false); });
+ [](const std::exception&) { ADD_FAILURE(); });
};
EXPECT_THROW(expect_runtime_error_rethrow(ew_eptr), std::runtime_error);
bool handled = false;
auto expect_runtime_error_yes_catch_all = [&](const exception_wrapper& ew) {
ew.handle(
- [](const std::logic_error&) { EXPECT_TRUE(false); },
- [](const std::runtime_error&) { EXPECT_TRUE(false); },
+ [](const std::logic_error&) { ADD_FAILURE(); },
+ [](const std::runtime_error&) { ADD_FAILURE(); },
[&](...) { handled = true; });
};
auto expect_int_yes_catch_all = [&](const exception_wrapper& ew) {
ew.handle(
- [](const std::exception&) { EXPECT_TRUE(false); },
+ [](const std::exception&) { ADD_FAILURE(); },
[&](...) { handled = true; });
};
auto expect_int_no_catch_all = [&](const exception_wrapper& ew) {
ew.handle(
- [](const std::exception&) { EXPECT_TRUE(false); },
+ [](const std::exception&) { ADD_FAILURE(); },
[&](const int&) { handled = true; });
};
auto expect_int_no_catch_all_2 = [&](const exception_wrapper& ew) {
ew.handle(
[&](const int&) { handled = true; },
- [](const std::exception&) { EXPECT_TRUE(false); });
+ [](const std::exception&) { ADD_FAILURE(); });
};
expect_int_no_catch_all_2(ew_eptr1);
auto expect_int_yes_catch_all = [&](const exception_wrapper& ew) {
ew.handle(
- [](const std::exception&) { EXPECT_TRUE(false); },
+ [](const std::exception&) { ADD_FAILURE(); },
[&](...) { handled = true; });
};
auto expect_int_no_catch_all = [&](const exception_wrapper& ew) {
ew.handle(
- [](const std::exception&) { EXPECT_TRUE(false); },
+ [](const std::exception&) { ADD_FAILURE(); },
[&](const BigNonStdError&) { handled = true; });
};
auto expect_int_no_catch_all_2 = [&](const exception_wrapper& ew) {
ew.handle(
[&](const BigNonStdError&) { handled = true; },
- [](const std::exception&) { EXPECT_TRUE(false); });
+ [](const std::exception&) { ADD_FAILURE(); });
};
expect_int_no_catch_all_2(ew_eptr1);
handled = true;
throw e;
},
- [](const BaseException&) { EXPECT_TRUE(false); }),
+ [](const BaseException&) { ADD_FAILURE(); }),
DerivedException);
EXPECT_TRUE(handled);
handled = false;
handled = true;
throw e;
},
- [](...) { EXPECT_TRUE(false); }),
+ [](...) { ADD_FAILURE(); }),
DerivedException);
EXPECT_TRUE(handled);
}