Skip to content

Commit bbd4461

Browse files
asmellbykartben
authored andcommitted
tests: drivers: watchdog: Support window.min
Add test flag to support running error case test on devices with support for window.min Signed-off-by: Aksel Skauge Mellbye <[email protected]>
1 parent af4cbdc commit bbd4461

File tree

1 file changed

+9
-6
lines changed
  • tests/drivers/watchdog/wdt_error_cases/src

1 file changed

+9
-6
lines changed

tests/drivers/watchdog/wdt_error_cases/src/main.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#define WDT_OPT_PAUSE_IN_SLEEP_SUPPORTED BIT(5)
3737
#define WDT_OPT_PAUSE_HALTED_BY_DBG_SUPPORTED BIT(6)
3838
#define WDT_FEED_CAN_STALL BIT(7)
39+
#define WDT_WINDOW_MIN_SUPPORTED BIT(8)
3940

4041
/* Common for all targets: */
4142
#define DEFAULT_WINDOW_MAX (500U)
@@ -276,12 +277,14 @@ ZTEST(wdt_coverage, test_04w_wdt_install_timeout_with_invalid_window)
276277
/* ----------------- window.min
277278
* Check that window.min can't be different than 0
278279
*/
279-
m_cfg_wdt0.window.min = 1U;
280-
ret = wdt_install_timeout(wdt, &m_cfg_wdt0);
281-
zassert_true(ret == -EINVAL,
282-
"Calling wdt_install_timeout with window.min = 1 should return -EINVAL (-22), "
283-
"got unexpected value of %d",
284-
ret);
280+
if (!(WDT_TEST_FLAGS & WDT_WINDOW_MIN_SUPPORTED)) {
281+
m_cfg_wdt0.window.min = 1U;
282+
ret = wdt_install_timeout(wdt, &m_cfg_wdt0);
283+
zassert_true(ret == -EINVAL,
284+
"Calling wdt_install_timeout with window.min = 1 should return -EINVAL (-22), "
285+
"got unexpected value of %d",
286+
ret);
287+
}
285288

286289
/* Set default window.min */
287290
m_cfg_wdt0.window.min = DEFAULT_WINDOW_MIN;

0 commit comments

Comments
 (0)