|
6 | 6 | * Change Logs: |
7 | 7 | * Date Author Notes |
8 | 8 | * 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)" |
9 | 42 | */ |
10 | 43 |
|
11 | 44 | #include <rtthread.h> |
|
0 commit comments