From 369a54514fbca30254fe319f22409b1b75c19fc3 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Tue, 7 Dec 2021 09:36:24 -0600 Subject: [PATCH] tests: kernel: threads: Correct test assertion in thread_apis test Thread APIs test for k_busy_wait incorrectly asserted that a delay of 100 us should produce a delay in cycles less than or equal to to 100 cycles of the hardware clock. Since most hardware clocks are fast, this assertion was valid, but it does not test for the actual delay. Fix the assertion to verify that a delay of 100 us produces a delay in cycles less than or equal to 100 us worth of hardware clock cycles. Signed-off-by: Daniel DeGrasse --- tests/kernel/threads/thread_apis/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kernel/threads/thread_apis/src/main.c b/tests/kernel/threads/thread_apis/src/main.c index eb58f614a35..6ec4ae31b69 100644 --- a/tests/kernel/threads/thread_apis/src/main.c +++ b/tests/kernel/threads/thread_apis/src/main.c @@ -591,7 +591,7 @@ void test_k_busy_wait(void) /* execution_cycles increases correctly */ dt = test_stats.execution_cycles - cycles; - zassert_true(dt >= k_cyc_to_us_floor64(100), NULL); + zassert_true(dt >= k_us_to_cyc_floor64(100), NULL); } static void tp_entry(void *p1, void *p2, void *p3)