Merge 86fe8a25eb5a6e4546f9e39cf23a5c764217bf85 into 440527a61e

Closes #1867

PiperOrigin-RevId: 215392714
This commit is contained in:
Marco Bubke
2018-10-02 11:31:21 -04:00
committed by Gennadiy Civil
parent 00938b2b22
commit 7796273056
3 changed files with 45 additions and 26 deletions

View File

@@ -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 {