feature: utest: add standardized utest documentation to hooklist_tc

Signed-off-by: Ze-Hou <yingkezhou@qq.com>
This commit is contained in:
Ze-Hou
2025-11-13 10:11:31 +08:00
committed by R b b666
parent ddfe2cd61c
commit 538e5ff6d5

View File

@@ -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 <rtthread.h>