diff options
Diffstat (limited to 'test/gmock-actions_test.cc')
-rw-r--r-- | test/gmock-actions_test.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/gmock-actions_test.cc b/test/gmock-actions_test.cc index fd87c74c..1210d464 100644 --- a/test/gmock-actions_test.cc +++ b/test/gmock-actions_test.cc @@ -634,15 +634,19 @@ TEST(DoDefaultTest, ReturnsBuiltInDefaultValueByDefault) { EXPECT_EQ(0, mock.IntFunc(true)); } -// Tests that DoDefault() aborts the process when there is no built-in -// default value for the return type. +// Tests that DoDefault() throws (when exceptions are enabled) or aborts +// the process when there is no built-in default value for the return type. TEST(DoDefaultDeathTest, DiesForUnknowType) { MockClass mock; EXPECT_CALL(mock, Foo()) .WillRepeatedly(DoDefault()); +#if GTEST_HAS_EXCEPTIONS + EXPECT_ANY_THROW(mock.Foo()); +#else EXPECT_DEATH_IF_SUPPORTED({ mock.Foo(); }, ""); +#endif } // Tests that using DoDefault() inside a composite action leads to a |