Closed pathakraul closed 3 months ago
In your test, you may set up as many expectations as desired, in order... so in your instance, it would look like this:
TEST()
{
read_ExpectAndReturn();
write_ExpectAndReturn();
read_ExpectAndReturn();
write_ExpectAndReturn();
TEST_ASSERT_***(..., func_to_test())
}
I suspect you'd also want to look into the return-thru-pointer plugin to handle the val1, and val2 returns in the read
functions.
Hi, I am unable to find any way to test this scenario.
I have mocked version of
read
andwrite
and a functionfunc_to_test()
which calls them multiple times.In this case how can I call the mocked versions
read_***()
andwrite_***()
before theTEST_ASSERT_**
which calls myfunc_to_test
such that they take affect with different values for different calls inside the test function. Or what is the right way to test this caseThanks, Rahul