aboutsummaryrefslogtreecommitdiffstats
path: root/include/gmock
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2009-02-06 01:09:43 +0000
committerzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2009-02-06 01:09:43 +0000
commite1cdce5f761ed0fb04be0aea4d1b9138e9dbc1f7 (patch)
tree7460e6ee2c8098de00d09294ecb5f6d2b8f3c2b4 /include/gmock
parentc069d7fe27bfe8cfdaff77ef38455688c453c28d (diff)
downloadgoogletest-e1cdce5f761ed0fb04be0aea4d1b9138e9dbc1f7.tar.gz
googletest-e1cdce5f761ed0fb04be0aea4d1b9138e9dbc1f7.tar.bz2
googletest-e1cdce5f761ed0fb04be0aea4d1b9138e9dbc1f7.zip
Implements action Throw(exception).
Diffstat (limited to 'include/gmock')
-rw-r--r--include/gmock/gmock-generated-actions.h10
-rw-r--r--include/gmock/gmock-generated-actions.h.pump10
2 files changed, 20 insertions, 0 deletions
diff --git a/include/gmock/gmock-generated-actions.h b/include/gmock/gmock-generated-actions.h
index 5188b917..b67fa982 100644
--- a/include/gmock/gmock-generated-actions.h
+++ b/include/gmock/gmock-generated-actions.h
@@ -2298,4 +2298,14 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \
arg8_type arg8, arg9_type arg9) const
+namespace testing {
+
+// Action Throw(exception) can be used in a mock function of any type
+// to throw the given exception. Any copyable value can be thrown.
+#if GTEST_HAS_EXCEPTIONS
+ACTION_P(Throw, exception) { throw exception; }
+#endif // GTEST_HAS_EXCEPTIONS
+
+} // namespace testing
+
#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
diff --git a/include/gmock/gmock-generated-actions.h.pump b/include/gmock/gmock-generated-actions.h.pump
index 7b042ff8..0c403eb6 100644
--- a/include/gmock/gmock-generated-actions.h.pump
+++ b/include/gmock/gmock-generated-actions.h.pump
@@ -772,4 +772,14 @@ $arg_types_and_names) const
]]
+namespace testing {
+
+// Action Throw(exception) can be used in a mock function of any type
+// to throw the given exception. Any copyable value can be thrown.
+#if GTEST_HAS_EXCEPTIONS
+ACTION_P(Throw, exception) { throw exception; }
+#endif // GTEST_HAS_EXCEPTIONS
+
+} // namespace testing
+
#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_