vendredi 29 novembre 2019

Can Google Mock EXPECT_CALL also just store the parameter?

For Google mock I can verify any value with EXPECT_CALL(class-instance, function(_));

In this case I need to store the parameter _ in my test for using further in the test. It is not a value, but a pointer to a function. How to do this?

What I need in pseudo code:

TEST(myFixture, test001)
EXPECT_CALL(class-instance, function(_)).do(this->pointer = %1);
…
// end of test
EXPECT_EQ(this->pointer(2), 4);

What should be instead of %1?
note: "this->" is just to emphasize it is a local parameter.

Aucun commentaire:

Enregistrer un commentaire