Skip to content

Commit a8c7f82

Browse files
mmahadevan108dleach02
authored andcommitted
tests: counter: Fix test_multiple_alarms in counter_basic_api
Skip the test_multiple_alarms() test when the settop value is not supported. This is to avoid the case where wrap around take a long time thereby causing test failures Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 649bb3b commit a8c7f82

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/drivers/counter/counter_basic_api/src/test_counter.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,12 @@ void test_multiple_alarms_instance(const char *dev_name)
554554
if (set_top_value_capable(dev_name)) {
555555
err = counter_set_top_value(dev, &top_cfg);
556556
zassert_equal(0, err, "%s: Counter failed to set top value", dev_name);
557+
} else {
558+
/* Counter does not support top value, do not run this test
559+
* as it might take a long time to wrap and trigger the alarm
560+
* resulting in test failures.
561+
*/
562+
return;
557563
}
558564

559565
k_busy_wait(3*(uint32_t)counter_ticks_to_us(dev, alarm_cfg.ticks));

0 commit comments

Comments
 (0)