Merge 86fe8a25eb5a6e4546f9e39cf23a5c764217bf85 into 440527a61e
Closes #1867 PiperOrigin-RevId: 215392714
This commit is contained in:
committed by
Gennadiy Civil
parent
00938b2b22
commit
7796273056
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user