From ecd569a47ebab888401e2589dd238ea5202658f0 Mon Sep 17 00:00:00 2001 From: Ze-Hou Date: Mon, 17 Nov 2025 18:10:34 +0800 Subject: [PATCH] feature: utest: add standardized utest documentation to timer_tc Signed-off-by: Ze-Hou --- src/utest/timer_tc.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/utest/timer_tc.c b/src/utest/timer_tc.c index c732efb5ba5..6ceeeb442dd 100644 --- a/src/utest/timer_tc.c +++ b/src/utest/timer_tc.c @@ -6,6 +6,39 @@ * Change Logs: * Date Author Notes * 2021-08-12 luckyzjq the first version + * 2025-11-17 Ze-Hou add standardized utest documentation block + */ + +/** + * Test Case Name: Kernel Core Timer Test + * + * Test Objectives: + * - Validate the RT-Thread kernel timer (rt_timer) functionality + * - Test static and dynamic timer creation, initialization, start, stop, delete, + * detach, and control APIs + * - Verify one-shot and periodic timer behaviors, including hard and soft timer modes + * + * Test Scenarios: + * - Initialize and start static timers in one-shot and periodic modes, with various flag combinations + * - Start a timer twice before it expires to verify restart behavior + * - Use timer control APIs to set and get timer period, and verify correct timing + * - Start and stop timers within their callback functions to test reentrancy and robustness + * - Create, start, stop, and delete dynamic timers, verifying correct operation and resource management + * - Perform stress testing by rapidly starting and stopping a large number of timers concurrently + * + * Verification Metrics: + * - All uassert assertions pass without failure + * - Timers are created, started, stopped, detached, and deleted successfully + * - Timer callbacks are invoked at the expected tick count + * - Timer restart and control operations behave as expected + * + * Dependencies: + * - Enable Timer Test (RT-Thread Utestcases -> Kernel Core -> Timer Test) + * - Test on any RT-Thread supported platform (e.g., qemu-virt64-riscv) + * + * Expected Results: + * - After executing this test in msh, the expected output should be: + * "[ PASSED ] [ result ] testcase (core.timer)" */ #include