diff options
author | Marco Bubke <30830880+marbub@users.noreply.github.com> | 2018-10-02 11:31:21 -0400 |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2018-10-02 13:03:35 -0400 |
commit | 77962730563eece3525f40b8769e4ca0c6baf64c (patch) | |
tree | 2a4381a3cc365bebba95e7c3bc2344ec8325f3ff /googlemock/test/gmock-generated-function-mockers_test.cc | |
parent | 00938b2b228f3b70d3d9e51f29a1505bdad43f1e (diff) | |
download | googletest-77962730563eece3525f40b8769e4ca0c6baf64c.tar.gz googletest-77962730563eece3525f40b8769e4ca0c6baf64c.tar.bz2 googletest-77962730563eece3525f40b8769e4ca0c6baf64c.zip |
Merge 86fe8a25eb5a6e4546f9e39cf23a5c764217bf85 into 440527a61e1c91188195f7de212c63c77e8f0a45
Closes #1867
PiperOrigin-RevId: 215392714
Diffstat (limited to 'googlemock/test/gmock-generated-function-mockers_test.cc')
-rw-r--r-- | googlemock/test/gmock-generated-function-mockers_test.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/googlemock/test/gmock-generated-function-mockers_test.cc b/googlemock/test/gmock-generated-function-mockers_test.cc index f16833b2..4c490694 100644 --- a/googlemock/test/gmock-generated-function-mockers_test.cc +++ b/googlemock/test/gmock-generated-function-mockers_test.cc @@ -617,6 +617,17 @@ TEST(MockFunctionTest, AsStdFunctionReturnsReference) { value = 2; EXPECT_EQ(2, ref); } + +TEST(MockFunctionTest, AsStdFunctionWithReferenceParameter) { + MockFunction<int(int &)> foo; + auto call = [](const std::function<int(int& )> &f, int &i) { + return f(i); + }; + int i = 42; + EXPECT_CALL(foo, Call(i)).WillOnce(Return(-1)); + EXPECT_EQ(-1, call(foo.AsStdFunction(), i)); +} + #endif // GTEST_HAS_STD_FUNCTION_ struct MockMethodSizes0 { |