Skip to content

Commit ecd569a

Browse files
committed
feature: utest: add standardized utest documentation to timer_tc
Signed-off-by: Ze-Hou <[email protected]>
1 parent 30e1e5e commit ecd569a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/utest/timer_tc.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,39 @@
66
* Change Logs:
77
* Date Author Notes
88
* 2021-08-12 luckyzjq the first version
9+
* 2025-11-17 Ze-Hou add standardized utest documentation block
10+
*/
11+
12+
/**
13+
* Test Case Name: Kernel Core Timer Test
14+
*
15+
* Test Objectives:
16+
* - Validate the RT-Thread kernel timer (rt_timer) functionality
17+
* - Test static and dynamic timer creation, initialization, start, stop, delete,
18+
* detach, and control APIs
19+
* - Verify one-shot and periodic timer behaviors, including hard and soft timer modes
20+
*
21+
* Test Scenarios:
22+
* - Initialize and start static timers in one-shot and periodic modes, with various flag combinations
23+
* - Start a timer twice before it expires to verify restart behavior
24+
* - Use timer control APIs to set and get timer period, and verify correct timing
25+
* - Start and stop timers within their callback functions to test reentrancy and robustness
26+
* - Create, start, stop, and delete dynamic timers, verifying correct operation and resource management
27+
* - Perform stress testing by rapidly starting and stopping a large number of timers concurrently
28+
*
29+
* Verification Metrics:
30+
* - All uassert assertions pass without failure
31+
* - Timers are created, started, stopped, detached, and deleted successfully
32+
* - Timer callbacks are invoked at the expected tick count
33+
* - Timer restart and control operations behave as expected
34+
*
35+
* Dependencies:
36+
* - Enable Timer Test (RT-Thread Utestcases -> Kernel Core -> Timer Test)
37+
* - Test on any RT-Thread supported platform (e.g., qemu-virt64-riscv)
38+
*
39+
* Expected Results:
40+
* - After executing this test in msh, the expected output should be:
41+
* "[ PASSED ] [ result ] testcase (core.timer)"
942
*/
1043

1144
#include <rtthread.h>

0 commit comments

Comments
 (0)