Gmock setting out parameter
Posted
by
user1135541
on Stack Overflow
See other posts from Stack Overflow
or by user1135541
Published on 2014-06-05T03:23:53Z
Indexed on
2014/06/05
3:24 UTC
Read the original article
Hit count: 116
Have a gmock method, and during test, need to set the out parameter to variable address. So that the out parameter of dequeue, which is data points to variable ch;
MOCK_METHOD1(dequeue, void(void* data));
char ch = 'm';
void* a = (void*)&ch;
EXPECT_CALL(FQO, dequeue(_))
.WillOnce(/*here I need to set argument to a*/);
I tried to figure out side effects: https://code.google.com/p/googlemock/wiki/V1_7_CheatSheet#Side_Effects but keep getting an error.
© Stack Overflow or respective owner