From f550259b044d2370d9d32dce7df8d5d2d762fa41 Mon Sep 17 00:00:00 2001 From: Ze-Hou Date: Thu, 13 Nov 2025 10:11:31 +0800 Subject: [PATCH] feature: utest: add standardized utest documentation to hooklist_tc Signed-off-by: Ze-Hou --- src/utest/hooklist_tc.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/utest/hooklist_tc.c b/src/utest/hooklist_tc.c index ef6a8548e71..bd3705f9326 100644 --- a/src/utest/hooklist_tc.c +++ b/src/utest/hooklist_tc.c @@ -6,6 +6,35 @@ * Change Logs: * Date Author Notes * 2023-12-22 Shell Support hook list + * 2025-11-11 Ze-Hou Add standardized utest documentation block + */ + +/** + * Test Case Name: Kernel Core Hook List Test + * + * Test Objectives: + * - Validate the RT-Thread hook list mechanism for thread initialization events + * - Test registration, invocation, and removal of thread-initialized hooks + * + * Test Scenarios: + * - Register two hook nodes for thread initialization + * - Initialize a thread and check that both hooks are called + * - Remove one hook and re-initialize the thread, verifying only the remaining hook is called + * - Detach thread and clean up hooks after test + * + * Verification Metrics: + * - hooker1_ent_count and hooker2_ent_count increment as expected + * - After first thread init: both counters == 1 + * - After second thread init (with one hook removed): hooker1_ent_count == 2, hooker2_ent_count == 1 + * - After running this test case, check whether all assertions pass. + * + * Dependencies: + * - Enable Hook List Test (RT-Thread Utestcases -> Kernel Core -> Hook List 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.hooklist)" */ #include