Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/utest/hooklist_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] [Date Format Issue / 日期格式问题]

English: The date "2025-11-11" appears to be in the future (the current date should be around November 2025, but this appears to be setting November 11, 2025). Please verify this is the correct date. If this was committed earlier or the date is incorrect, it should be adjusted to reflect the actual date of the change.

中文:日期"2025-11-11"似乎是2025年11月11日。请验证这是正确的日期。如果这是在更早提交的或日期不正确,应调整为实际更改日期。

Note: If this is indeed the correct current date, please disregard this comment.
注意:如果这确实是正确的当前日期,请忽略此评论。

Suggested change
* 2025-11-11 Ze-Hou Add standardized utest documentation block
* 2024-06-10 Ze-Hou Add standardized utest documentation block

Copilot uses AI. Check for mistakes.
*/

/**
* 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>
Expand Down