Commit 184b633f authored by Ioannis Karachalios's avatar Ioannis Karachalios Committed by Johan Hedberg
Browse files

tests: drivers: counter: Test failure when counter is running upwards



The "test_late_alarm_error" test vector comes with an update that
should result in test failure when the target counter runs upwards.
That test vector attempts to set an alarm event that is passed the
current tick value. Therefore, counter's direction should be exercised
and then an appropriate alarm event should be defined.

Signed-off-by: default avatarIoannis Karachalios <ioannis.karachalios.px@renesas.com>
parent b901daa8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -868,7 +868,7 @@ static void test_late_alarm_error_instance(const struct device *dev)

	k_busy_wait(2*tick_us);

	alarm_cfg.ticks = counter_get_top_value(dev);
	alarm_cfg.ticks = counter_is_counting_up(dev) ? 0 : counter_get_top_value(dev);
	err = counter_set_channel_alarm(dev, 0, &alarm_cfg);
	zassert_equal(-ETIME, err,
			"%s: Failed to detect late setting (err: %d)",