You can use fault injection(code injection) and test macros to determine the success/failure of a test case based on the value of a local variable at a specific point in the source code. This method allows limited validation of local variables.

In fault injection view, insert the following code in the point where you want to check the value of the local variable.

if(CS_TESTCASENO() == 1) {
        CS_ASSERT(temp == 0);
}

After inserting the code and running the tests, test case #1 fails if value of temp in the corresponding part is not 0.

Need more help with this?
Don’t hesitate to contact us here.

Thanks for your feedback.