Skip to content
Commit 285bfa7f authored by Piotr Zięcik's avatar Piotr Zięcik Committed by Carles Cufí
Browse files

tests: work_queue_api: Fix k_delayed_work_remaining_get() test



Existing test checking value returned by k_delayed_work_remaining_get()
verified two cases:

1) The k_delayed_work_remaining_get() should return 0 for non-submitted
   work.

2) The k_delayed_work_remaining_get() should return value greater or
   equal to the timeout value of just submitted work.

Unfortunately, the second check is not correct. The value returned
by the k_delayed_work_remaining_get() just after submitting delayed
work should be:

- Equal to timeout of the submitted work if no timer interrupt was
  executed between submitting work and checking remaining time.

  OR

- Less than timeout of the submitted work if a timer interrupt was
  executed between submitting work and checking remaining time.

This commit changes the test accordingly taking under account the
error caused by back and forth conversion between ms and ticks.

Signed-off-by: default avatarPiotr Zięcik <piotr.ziecik@nordicsemi.no>
parent 25d7a09a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment