tests: arm_no_multithreading: confirm IRQ index being non-negative
Check that the index returned by the function that looks for an available IRQ line is non-negative, and do not just rely on catching this with an ASSERT. That suppresses a Coverity out-of-bounds warning. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
parent
5c6df442ff
commit
13cde704e9
1 changed files with 15 additions and 13 deletions
|
@ -96,8 +96,7 @@ void test_main(void)
|
|||
}
|
||||
}
|
||||
|
||||
__ASSERT(i >= 0,
|
||||
"No available IRQ line to use in the test\n");
|
||||
if (i >= 0) {
|
||||
|
||||
printk("Available IRQ line: %u\n", i);
|
||||
|
||||
|
@ -116,4 +115,7 @@ void test_main(void)
|
|||
__ASSERT(flag > 0, "Test flag not set by IRQ\n");
|
||||
|
||||
printk("ARM no multithreading test successful\n");
|
||||
} else {
|
||||
__ASSERT(0, "No available IRQ line to use in the test\n");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue