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 <mahesh.mahadevan@nxp.com>
This commit is contained in:
Mahesh Mahadevan 2022-05-19 17:10:48 -05:00 committed by David Leach
commit a8c7f82510

View file

@ -554,6 +554,12 @@ void test_multiple_alarms_instance(const char *dev_name)
if (set_top_value_capable(dev_name)) {
err = counter_set_top_value(dev, &top_cfg);
zassert_equal(0, err, "%s: Counter failed to set top value", dev_name);
} else {
/* Counter does not support top value, do not run this test
* as it might take a long time to wrap and trigger the alarm
* resulting in test failures.
*/
return;
}
k_busy_wait(3*(uint32_t)counter_ticks_to_us(dev, alarm_cfg.ticks));