Skip to content

Commit f550259

Browse files
committed
feature: utest: add standardized utest documentation to hooklist_tc
Signed-off-by: Ze-Hou <yingkezhou@qq.com>
1 parent 0d78fa4 commit f550259

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/utest/hooklist_tc.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,35 @@
66
* Change Logs:
77
* Date Author Notes
88
* 2023-12-22 Shell Support hook list
9+
* 2025-11-11 Ze-Hou Add standardized utest documentation block
10+
*/
11+
12+
/**
13+
* Test Case Name: Kernel Core Hook List Test
14+
*
15+
* Test Objectives:
16+
* - Validate the RT-Thread hook list mechanism for thread initialization events
17+
* - Test registration, invocation, and removal of thread-initialized hooks
18+
*
19+
* Test Scenarios:
20+
* - Register two hook nodes for thread initialization
21+
* - Initialize a thread and check that both hooks are called
22+
* - Remove one hook and re-initialize the thread, verifying only the remaining hook is called
23+
* - Detach thread and clean up hooks after test
24+
*
25+
* Verification Metrics:
26+
* - hooker1_ent_count and hooker2_ent_count increment as expected
27+
* - After first thread init: both counters == 1
28+
* - After second thread init (with one hook removed): hooker1_ent_count == 2, hooker2_ent_count == 1
29+
* - After running this test case, check whether all assertions pass.
30+
*
31+
* Dependencies:
32+
* - Enable Hook List Test (RT-Thread Utestcases -> Kernel Core -> Hook List Test)
33+
* - Test on any RT-Thread supported platform (e.g., qemu-virt64-riscv)
34+
*
35+
* Expected Results:
36+
* - After executing this test in msh, the expected output should be:
37+
* "[ PASSED ] [ result ] testcase (core.hooklist)"
938
*/
1039

1140
#include <rtthread.h>

0 commit comments

Comments
 (0)