Skip to content

Commit b97fc40

Browse files
committed
tests: drivers: timer: grtc_timer_lfrc: adjust for coverage mode
Relax timing expectation when using CONFIG_COVERAGE. Signed-off-by: Piotr Kosycarz <[email protected]>
1 parent 47fb5dc commit b97fc40

File tree

1 file changed

+6
-1
lines changed
  • tests/drivers/timer/grtc_timer_lfrc/src

1 file changed

+6
-1
lines changed

tests/drivers/timer/grtc_timer_lfrc/src/main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
#include <zephyr/drivers/clock_control/nrf_clock_control.h>
1212

1313
#define REQUEST_SERVING_WAIT_TIME_US 10000
14+
#if defined(CONFIG_COVERAGE)
15+
#define DIFF_TOLERANCE 2
16+
#else
17+
#define DIFF_TOLERANCE 1
18+
#endif
1419

1520
typedef enum {
1621
NO_CHANGE = 0,
@@ -167,7 +172,7 @@ static void test_timer_compare(const struct accuracy_test_limit *test_limit,
167172
compare_count_value - compare_value);
168173

169174
zassert_true((compare_count_value - compare_value) <
170-
test_limit->final_max_ticks_count_difference,
175+
test_limit->final_max_ticks_count_difference * DIFF_TOLERANCE,
171176
"Maximal final ticks count difference is over the limit");
172177
z_nrf_grtc_timer_chan_free(channel);
173178
}

0 commit comments

Comments
 (0)