aboutsummaryrefslogtreecommitdiffstats
path: root/test/gmock-generated-actions_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/gmock-generated-actions_test.cc')
-rw-r--r--test/gmock-generated-actions_test.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/gmock-generated-actions_test.cc b/test/gmock-generated-actions_test.cc
index cf3c7891..885097c7 100644
--- a/test/gmock-generated-actions_test.cc
+++ b/test/gmock-generated-actions_test.cc
@@ -59,6 +59,7 @@ using testing::DoAll;
using testing::Invoke;
using testing::InvokeArgument;
using testing::Return;
+using testing::ReturnArg;
using testing::ReturnNew;
using testing::SaveArg;
using testing::SetArgReferee;
@@ -1382,6 +1383,21 @@ TEST(ActionPnMacroTest, CanExplicitlyInstantiateWithReferenceTypes) {
EXPECT_EQ(55, a.Perform(empty));
}
+TEST(ReturnArgActionTest, WorksForOneArgIntArg0) {
+ const Action<int(int)> a = ReturnArg<0>();
+ EXPECT_EQ(5, a.Perform(make_tuple(5)));
+}
+
+TEST(ReturnArgActionTest, WorksForMultiArgBoolArg0) {
+ const Action<bool(bool, bool, bool)> a = ReturnArg<0>();
+ EXPECT_TRUE(a.Perform(make_tuple(true, false, false)));
+}
+
+TEST(ReturnArgActionTest, WorksForMultiArgStringArg2) {
+ const Action<string(int, int, string, int)> a = ReturnArg<2>();
+ EXPECT_EQ("seven", a.Perform(make_tuple(5, 6, string("seven"), 8)));
+}
+
TEST(SaveArgActionTest, WorksForSameType) {
int result = 0;
const Action<void(int n)> a1 = SaveArg<0>(&result);