tests/drivers/gpio_basic_api: improve test validation diagnostic
The test verifies that the output pin appears to be shorted to the input pin by confirming output low and high read low and high. Failure should block progress through the test as subsequent tests will not pass. Replace the use of k_panic() to halt the test with an infinite loop that doesn't splatter the console with stack traces and register dumps. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
f1e01e7e82
commit
d74e4f2d2a
1 changed files with 8 additions and 4 deletions
|
@ -81,8 +81,10 @@ static int setup(void)
|
|||
zassert_equal(rc, 0,
|
||||
"get raw low failed");
|
||||
if (raw_in() != false) {
|
||||
printk("FATAL: output low does not read low\n");
|
||||
k_panic();
|
||||
TC_PRINT("FATAL output pin not wired to input pin? (out low => in high)\n");
|
||||
while (true) {
|
||||
k_sleep(K_FOREVER);
|
||||
}
|
||||
}
|
||||
|
||||
zassert_equal(v1 & BIT(PIN_IN), 0,
|
||||
|
@ -96,8 +98,10 @@ static int setup(void)
|
|||
zassert_equal(rc, 0,
|
||||
"get raw high failed");
|
||||
if (raw_in() != true) {
|
||||
printk("FATAL: output high does not read high\n");
|
||||
k_panic();
|
||||
TC_PRINT("FATAL output pin not wired to input pin? (out high => in low)\n");
|
||||
while (true) {
|
||||
k_sleep(K_FOREVER);
|
||||
}
|
||||
}
|
||||
zassert_not_equal(v1 & BIT(PIN_IN), 0,
|
||||
"out high does not read low");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue