Skip to content

Commit 3c459ae

Browse files
ChuanN-sudoRbb666
authored andcommitted
[utest][mm_api]Add standardized documentation for MM API Test
1 parent 5782174 commit 3c459ae

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

examples/utest/testcases/mm/mm_api_tc.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,41 @@
77
* Date Author Notes
88
* 2022-12-14 WangXiaoyao the first version
99
* 2023-03-20 WangXiaoyao Format & add more testcases for API under mm_aspace.h
10+
* 2025-12-14 ChuanN-sudo Add standardized utest documentation block
11+
*/
12+
13+
/**
14+
* Test Case Name: MM API Test
15+
*
16+
* Test Objectives:
17+
* - Verify I/O remapping functionality with cached memory access.
18+
* - Test memory mapping flag creation and extraction mechanisms.
19+
* - Validate address space management operations.
20+
* - Test core APIs: rt_pages_alloc(), rt_ioremap_cached(), rt_iounmap(), rt_pages_free(),
21+
* rt_pages_free(), MMF_CREATE(), MMF_GET_CNTL(), MMF_GET_ALIGN().
22+
*
23+
* Test Scenarios:
24+
* - Address Space Test (aspace_tc): Tests memory address space management APIs.
25+
* - I/O Remap Test (ioremap_tc): Allocates physical pages, maps to virtual address with cache, verifies data consistency, and cleans up resources.
26+
* - Flag Test (flag_tc): Creates memory mapping flags with different parameters and validates control bits and alignment values extraction.
27+
*
28+
* Verification Metrics:
29+
* - I/O remapping should correctly map physical to virtual addresses.
30+
* - Cached memory access should maintain data consistency between physical and virtual addresses.
31+
* - Memory mapping flags should correctly encode and decode control bits and alignment values.
32+
* - Flag creation with alignment should set MMF_REQUEST_ALIGN bit and store alignment value.
33+
* - Flag creation without alignment should not set alignment-related bits.
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_API must be enabled (enable via: RT-Thread Utestcases -> RT-Thread Utestcases -> Memory Management Subsystem Testcase -> Enable Utest for MM API).
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.mm.api_tc)"
44+
* - No assertion failures during test execution.
1045
*/
1146
#include "common.h"
1247

0 commit comments

Comments
 (0)