tests/context: fix Coverity warning about array overrun

Coverity was warning about an array overrun that should never happen.
Add an extra check to verify that is indeed the case.

Coverity issue 152017.

Change-Id: Ie6269acaa85387ba051dbff87b4bfaab860517a6
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
Benjamin Walsh 2017-01-16 09:50:09 -05:00 committed by Anas Nashif
commit abaaf89d69

View file

@ -760,6 +760,12 @@ static int test_timeout(void)
break;
}
}
if (j == NUM_TIMEOUT_FIBERS) {
TC_ERROR(" *** array overrun: all timeout order values should have been between the boundaries\n");
return TC_FAIL;
}
task_fiber_delayed_start_cancel(delayed_fibers[j]);
++next_cancellation;
continue;