aboutsummaryrefslogtreecommitdiffstats
path: root/test/gmock-more-actions_test.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2010-07-03 00:16:42 +0000
committerzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2010-07-03 00:16:42 +0000
commite3bd0981ca06e682bcd03659286d7a3267c4d999 (patch)
treef5d9cad74e0398f6b18613220b5c7b0c52464a0d /test/gmock-more-actions_test.cc
parent02c1505ebfaadbc34b4cb85546796521d6f0e634 (diff)
downloadgoogletest-e3bd0981ca06e682bcd03659286d7a3267c4d999.tar.gz
googletest-e3bd0981ca06e682bcd03659286d7a3267c4d999.tar.bz2
googletest-e3bd0981ca06e682bcd03659286d7a3267c4d999.zip
Implements ReturnPointee() and ReturnRefOfCopy().
Diffstat (limited to 'test/gmock-more-actions_test.cc')
-rw-r--r--test/gmock-more-actions_test.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/gmock-more-actions_test.cc b/test/gmock-more-actions_test.cc
index b3b17d33..be7b1273 100644
--- a/test/gmock-more-actions_test.cc
+++ b/test/gmock-more-actions_test.cc
@@ -57,6 +57,7 @@ using testing::DeleteArg;
using testing::Invoke;
using testing::Return;
using testing::ReturnArg;
+using testing::ReturnPointee;
using testing::SaveArg;
using testing::SetArgReferee;
using testing::SetArgumentPointee;
@@ -664,5 +665,14 @@ TEST(SetArrayArgumentTest, SetsTheNthArrayWithIteratorArgument) {
EXPECT_EQ(letters, s);
}
+TEST(ReturnPointeeTest, Works) {
+ int n = 42;
+ const Action<int()> a = ReturnPointee(&n);
+ EXPECT_EQ(42, a.Perform(make_tuple()));
+
+ n = 43;
+ EXPECT_EQ(43, a.Perform(make_tuple()));
+}
+
} // namespace gmock_generated_actions_test
} // namespace testing