Usually the way to deal with this is to refactor the code a bit in:
void bsdpmsdgrx()
{
while(1)
doSomething();
}
This way you just test the doSomething without the loop.
Alternatively, you make the loop "end-ing" rather than "end-less" and I'm sure there are some conditions when the loop needs to be stopped ;)
Bas
On Aug 26, 2011, at 12:42 AM, xiaohong liu wrote:
> Terry, Bas
>
> Thank you both:) For current CUT, I will add a FAIL assert to break
> out of the loop. In the future refector, I will do the refactor.
Having a FAIL in the loop will mean the test will always fail. You need a test that passes when it is working. Can you refactor the body of the loop as Bas suggested and then test doSomething?
James