I have to test several routines/functions that have several if statements that leads to a terminate() or exit() statement that stops the test execution.
I was wondering what's the best/correct approach in testing functions like this?
For example, if I had something like the following:
void function foo(void)
{
if(conditionA)
{
Terminate( //include infinite while loop resulting in timeout);
}
if(conditionB)
{
Terminate( //includes infinite white loop resulting in timeout);
}
}
How do I hit conditionB when I have a test case that is true for conditionA?
I think I would have to create a separate test case for conditionB to be true (and condition A to be false). However, the test still executes conditionA because I have two test cases run. Test Case #1, will enter conditionA and exit the test. Withby Test Case #2, will not run because of Test Case #1.
So, how should I structure the flow of my testing paradigm?
Currently, I have a test suite for each function that contains several test cases.