Skip to content

EXPECT_CALL(...).WillOnce(...) not working with InvokeArgument and SetArgReferee #4592

Closed Answered by AeroSW
AeroSW asked this question in Community Help
Discussion options

You must be logged in to vote

So the answer to my post is relatively simple. I blame my short-sightedness behind not connecting how to use DoAll correctly and realizing that, since, the function isn't void, it's usage of .Will... requires it to have a mocked return as well.

        ui32 v = 5;
        EXPECT_CALL(*sdl_vulkan_instanceextensions_mock, JOMOCK_FUNC(_, _, _))
            .WillOnce(DoAll(SetArgReferee<1>(v), Return(SDL_TRUE)))
            .WillRepeatedly(DoAll(SetArgReferee<1>(v), Return(SDL_TRUE)));

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AeroSW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant