Просмотр исходного кода

feature: utest: add standardized utest documentation to hooklist_tc

Signed-off-by: Ze-Hou <yingkezhou@qq.com>
Ze-Hou 2 месяцев назад
Родитель
Сommit
538e5ff6d5
1 измененных файлов с 29 добавлено и 0 удалено
  1. 29 0
      src/utest/hooklist_tc.c

+ 29 - 0
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>