36#if GTEST_HAS_DEATH_TEST
44# if GTEST_HAS_EXCEPTIONS
50TEST(CxxExceptionDeathTest, ExceptionIsFailure) {
54 FAIL() <<
"An exception escaped a death test macro invocation "
55 <<
"with catch_exceptions "
56 << (testing::GTEST_FLAG(catch_exceptions) ?
"enabled" :
"disabled");
60class TestException :
public std::exception {
62 const char* what() const noexcept
override {
return "exceptional message"; }
65TEST(CxxExceptionDeathTest, PrintsMessageForStdExceptions) {
68 "exceptional message");
79TEST(SehExceptionDeasTest, CatchExceptionsDoesNotInterfere) {
80 EXPECT_DEATH(RaiseException(42, 0x0, 0, NULL),
"")
81 <<
"with catch_exceptions "
82 << (testing::GTEST_FLAG(catch_exceptions) ?
"enabled" :
"disabled");
88int main(
int argc,
char** argv) {
90 testing::GTEST_FLAG(catch_exceptions) = GTEST_ENABLE_CATCH_EXCEPTIONS_ != 0;
#define EXPECT_NONFATAL_FAILURE(statement, substr)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
#define TEST(test_suite_name, test_name)
GTEST_API_ void InitGoogleTest()