How to use Parasoft C++ Dynamic stubs
Options
Hello Community,
I am a first time user of Parasoft's dynamic stubs. I am evaluating this feature as an alternate to using Google mock.
If I have a function:
void Func3()
{
int b = 1;
Func4(*b);
Func5(b);
}
In my test case for testing 3 what is the appropriate Dynamic Stubs calls to have Func4 output the value of b to 5 and validate the input parameter to Func5 was 5??
Thank you,
Bill
Tagged:
0
Comments
-
Hello,
Assuming:
void Func4(int * bptr); void Func5(int b);
You could do it like this:
CPPTEST_ON_CALL("Func4")->Arg("bptr")->At()->Int(0)->Assign()->Int(5); CPPTEST_ON_CALL("Func5")->If()->Arg("b")->NotEqual()->Int(5)->Fail("Invalid state: b != 5");0