aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock
diff options
context:
space:
mode:
authorMaurice Gilden <Maurice.Gilden@teamviewer.com>2017-08-18 11:46:15 +0200
committerMaurice Gilden <Maurice.Gilden@teamviewer.com>2017-08-18 11:46:15 +0200
commitcc99900036ae3514d8918acba87817fa24f6c993 (patch)
tree54cd6d72520fb164beca903349bbcd3e443b4a1c /googlemock
parent95f18d99383c27bf645e8dc4f5dcaa188f6bafe3 (diff)
downloadgoogletest-cc99900036ae3514d8918acba87817fa24f6c993.tar.gz
googletest-cc99900036ae3514d8918acba87817fa24f6c993.tar.bz2
googletest-cc99900036ae3514d8918acba87817fa24f6c993.zip
Fix test if exceptions are not supported
Diffstat (limited to 'googlemock')
-rw-r--r--googlemock/test/gmock-nice-strict_test.cc6
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.