diff options
| author | Ze-Hou <[email protected]> | 2025-11-13 10:11:31 +0800 |
|---|---|---|
| committer | R b b666 <[email protected]> | 2025-11-13 16:23:15 +0800 |
| commit | 538e5ff6d54f70e0da73a37878da6cb9c03110d2 (patch) | |
| tree | 010d17a0809657bd044291166978a29f8ca48162 /src | |
| parent | ddfe2cd61cbe39e0f8fc200b6ef21ab223c842ca (diff) | |
feature: utest: add standardized utest documentation to hooklist_tc
Signed-off-by: Ze-Hou <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/utest/hooklist_tc.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/utest/hooklist_tc.c b/src/utest/hooklist_tc.c index ef6a8548e7..bd3705f932 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 <rtthread.h> |
