diff options
author | Maurice Gilden <Maurice.Gilden@teamviewer.com> | 2017-08-18 11:46:15 +0200 |
---|---|---|
committer | Maurice Gilden <Maurice.Gilden@teamviewer.com> | 2017-08-18 11:46:15 +0200 |
commit | cc99900036ae3514d8918acba87817fa24f6c993 (patch) | |
tree | 54cd6d72520fb164beca903349bbcd3e443b4a1c /googlemock/test/gmock-nice-strict_test.cc | |
parent | 95f18d99383c27bf645e8dc4f5dcaa188f6bafe3 (diff) | |
download | googletest-cc99900036ae3514d8918acba87817fa24f6c993.tar.gz googletest-cc99900036ae3514d8918acba87817fa24f6c993.tar.bz2 googletest-cc99900036ae3514d8918acba87817fa24f6c993.zip |
Fix test if exceptions are not supported
Diffstat (limited to 'googlemock/test/gmock-nice-strict_test.cc')
-rw-r--r-- | googlemock/test/gmock-nice-strict_test.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/googlemock/test/gmock-nice-strict_test.cc b/googlemock/test/gmock-nice-strict_test.cc index 5e6d53be..86706814 100644 --- a/googlemock/test/gmock-nice-strict_test.cc +++ b/googlemock/test/gmock-nice-strict_test.cc @@ -213,6 +213,7 @@ TEST(NiceMockTest, AllowsExpectedCall) { // the method. TEST(NiceMockTest, ThrowsExceptionForUnknownReturnTypes) { NiceMock<MockFoo> nice_foo; +#if GTEST_HAS_EXCEPTIONS try { nice_foo.ReturnSomething(); FAIL(); @@ -220,6 +221,11 @@ TEST(NiceMockTest, ThrowsExceptionForUnknownReturnTypes) { const std::string exception_msg(ex.what()); EXPECT_NE(exception_msg.find("ReturnSomething"), std::string::npos); } +#else + EXPECT_DEATH_IF_SUPPORTED({ + nice_foo.ReturnSomething(); + }, ""); +#endif } // Tests that an unexpected call on a nice mock fails. |