Skip to content

Commit b425d69

Browse files
ChuanN-sudoLinuxMint-User
authored andcommitted
[utest][mm_api]:Add standardized documentation for MM API lwp Test
1 parent de8f63e commit b425d69

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

examples/utest/testcases/mm/mm_lwp_tc.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,42 @@
66
* Change Logs:
77
* Date Author Notes
88
* 2023-03-27 WangXiaoyao testcase for lwp
9+
* 2025-12-14 ChuanN-sudo Add standardized utest documentation block
10+
*/
11+
12+
/**
13+
* Test Case Name: MM API lwp Test
14+
*
15+
* Test Objectives:
16+
* - Verify LWP user space virtual area mapping functionality.
17+
* - Test user memory accessibility checking mechanisms.
18+
* - Test core APIs: lwp_create(), lwp_user_space_init(), lwp_map_user_varea(),
19+
* lwp_map_user_varea_ext(), lwp_user_accessible_ext(), lwp_ref_dec()
20+
*
21+
* Test Scenarios:
22+
* - User Map Varea Test (user_map_varea_tc):
23+
* - test_user_map_varea(): Creates LWP, initializes user space, maps virtual area with default flags, verifies varea properties (cached, private mapping).
24+
* - test_user_map_varea_ext(): Creates LWP, maps virtual area with NOCACHE flag, verifies uncached memory attributes.
25+
* - Accessible Test (accessible_tc):
26+
* - test_user_accessible(): Creates LWP with user stack, tests accessibility checks for unmapped and mapped memory regions.
27+
*
28+
* Verification Metrics:
29+
* - Virtual areas should be correctly inserted with proper ordering.
30+
* - Default mapping should have cached attributes (MMU_MAP_U_RWCB).
31+
* - NOCACHE mapping should have uncached attributes (MMU_MAP_U_RW).
32+
* - Virtual addresses should be within user space range.
33+
* - Accessibility check should return false for unmapped memory, true for mapped memory.
34+
*
35+
* Dependencies:
36+
* - Hardware requirements: QEMU emulator or any hardware platform that supports RT-Thread with MMU.
37+
* - Software configuration:
38+
* - RT_UTEST_MM_LWP must be enabled (enable via: RT-Thread Utestcases -> RT-Thread Utestcases -> Memory Management Subsystem Testcase -> Enable Utest for MM API in lwp).
39+
* - RT_USING_SMART must be enabled (enable via: Enable RT-Thread Kernel -> RT-Thread Smart (microkernel on kernel/userland)).
40+
* - Environmental Assumptions: MMU support must be available on the target platform.
41+
*
42+
* Expected Results:
43+
* - Final output: "[ PASSED ] [ result ] testcase (testcases.lwp.mm_tc)"
44+
* - No assertion failures during test execution.
945
*/
1046

1147
#include "common.h"

0 commit comments

Comments
 (0)