Skip to content

Commit 3de1747

Browse files
jakubtopicnashif
authored andcommitted
tests: drivers: rtc: skip alarm callback test if not supported
Check for ENOTSUP on alarm callback test if ALARM functionality is enabled but callbacks are not supported Signed-off-by: Jakub Topic <[email protected]>
1 parent 2fc0c12 commit 3de1747

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/drivers/rtc/rtc_api/src/test_alarm_callback.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ ZTEST(rtc_api, test_alarm_callback)
5555
for (uint16_t i = 0; i < alarms_count; i++) {
5656
ret = rtc_alarm_set_callback(rtc, i, NULL, NULL);
5757

58-
zassert_ok(ret, "Failed to clear and disable alarm %d", i);
58+
if (ret == -ENOTSUP) {
59+
TC_PRINT("Alarm callbacks not supported\n");
60+
ztest_test_skip();
61+
} else {
62+
zassert_ok(ret, "Failed to clear and disable alarm %d", i);
63+
}
5964
}
6065

6166
/* Validate alarms supported fields */

0 commit comments

Comments
 (0)