aboutsummaryrefslogtreecommitdiff
path: root/googlemock/test/gmock_link_test.h
diff options
context:
space:
mode:
Diffstat (limited to 'googlemock/test/gmock_link_test.h')
-rw-r--r--googlemock/test/gmock_link_test.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/googlemock/test/gmock_link_test.h b/googlemock/test/gmock_link_test.h
index db11c2d2..cf0a985b 100644
--- a/googlemock/test/gmock_link_test.h
+++ b/googlemock/test/gmock_link_test.h
@@ -187,6 +187,7 @@ using testing::SetErrnoAndReturn;
#if GTEST_HAS_EXCEPTIONS
using testing::Throw;
+using testing::Rethrow;
#endif
using testing::ContainsRegex;
@@ -416,6 +417,14 @@ TEST(LinkTest, TestThrow) {
EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Throw(42));
EXPECT_THROW(mock.VoidFromString(nullptr), int);
}
+// Tests the linkage of the Rethrow action.
+TEST(LinkTest, TestRethrow) {
+ Mock mock;
+
+ EXPECT_CALL(mock, VoidFromString(_))
+ .WillOnce(Rethrow(std::make_exception_ptr(42)));
+ EXPECT_THROW(mock.VoidFromString(nullptr), int);
+}
#endif // GTEST_HAS_EXCEPTIONS
// The ACTION*() macros trigger warning C4100 (unreferenced formal