zephyr/tests/kernel
Vincent Wan 0b12a7b463 tests: timer_api: fix assertion in test_timer_remaining()
This commit fixes the assertion in test_timer_remaining() that checks
whether the remaining ticks on a timer is less than or equal to half of
the timer duration after a busy wait of that time. If the timer
duration corresponds to an odd number of ticks, 1 should be added to
the upper bound given k_timer_remaining_ticks() returns
<ticks til next deadline> - <elapsed ticks>,
and <elapsed ticks> is truncated to closest integer tick count.

For example, if
    dur_ticks = 3277
    <ticks til next deadline> = 3277
    <elapsed ticks> = 1638.5 rounded to 1638

rem_ticks would be 1639, which is 1 greater than dur_ticks/2.

Fixes #25331

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-05-18 11:08:21 +02:00
..
common timer: remove QEMU_TICKLESS_WORKAROUND 2020-05-14 13:52:07 +02:00
context tests: kernel: context: Fix test_busy_wait timeout 2020-05-11 21:34:35 +02:00
device tests: ztest: prefix tests with test_ 2020-05-13 18:16:07 +02:00
early_sleep
fatal tests: Rename kernel.common.stack_protection_arm_fp_sharing 2020-05-08 10:58:33 +02:00
fifo
fpu_sharing tests: Rename kernel.fp_sharing 2020-05-08 10:58:33 +02:00
gen_isr_table
interrupt boards: arm: Add bcm958402m2_a72 board 2020-05-08 10:46:23 +02:00
lifo
mbox tests: ztest: prefix tests with test_ 2020-05-13 18:16:07 +02:00
mem_heap/mheap_api_concept tests/kernel: Fill allocation robustly for mpool heap backend 2020-04-14 10:05:55 -07:00
mem_pool tests/kernel/mem_pool: Split out tests for legacy mem_pool config 2020-04-14 10:05:55 -07:00
mem_protect tests: userspace: check for TLS leakage 2020-05-13 22:02:48 +02:00
mem_slab
mp
msgq/msgq_api test: msgq: remove number of cpu restriction 2020-05-09 19:06:53 +02:00
mutex
obj_tracing
pending kernel: remove unused offload workqueue option 2020-04-12 18:42:27 -04:00
pipe tests: kernel: pipe: tests for read_avail write_avail 2020-05-07 19:39:53 +02:00
poll
profiling/profiling_api
queue tests/kernel: Fill allocation robustly for mpool heap backend 2020-04-14 10:05:55 -07:00
sched timer: remove QEMU_TICKLESS_WORKAROUND 2020-05-14 13:52:07 +02:00
semaphore/semaphore
sleep timer: remove QEMU_TICKLESS_WORKAROUND 2020-05-14 13:52:07 +02:00
smp
spinlock
stack/stack
threads kernel: fix issue with k_thread_join() timeouts 2020-05-05 11:43:08 -07:00
tickless
timer tests: timer_api: fix assertion in test_timer_remaining() 2020-05-18 11:08:21 +02:00
workq tests: kernel: reduce test interval to save execution time 2020-05-14 13:52:07 +02:00
xip