tests: wdt_basic_api: pass when requested test is not supported

Not all watchdog devices support a warning callback before reset.  If
the driver refuses to accept that configuration record the test as
having passed.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-06-29 09:08:35 -05:00 committed by Anas Nashif
parent 5eef2c5f24
commit cb5e45c884

View file

@ -218,6 +218,12 @@ static int test_wdt_callback_1(void)
m_cfg_wdt0.window.max = 2000U;
err = wdt_install_timeout(wdt, &m_cfg_wdt0);
if (err < 0) {
if (err == -ENOTSUP) {
TC_PRINT("CB1 not supported on platform\n");
m_testcase_index++;
return TC_PASS;
}
TC_PRINT("Watchdog install error\n");
return TC_FAIL;
}