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:
Ioannis Glaropoulos 2021-04-15 17:26:17 +02:00 committed by Kumar Gala
commit 13cde704e9

View file

@ -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");
}
}