|
7 | 7 | * Date Author Notes |
8 | 8 | * 2021-09-08 liukang the first version |
9 | 9 | * 2023-09-15 xqyjlj change stack size in cpu64 |
| 10 | + * 2025-11-16 ChuanN-sudo add standardized utest documentation block |
| 11 | + */ |
| 12 | + |
| 13 | +/** |
| 14 | + * Test Case Name: IPC Mailbox Test |
| 15 | + * |
| 16 | + * Test Objectives: |
| 17 | + * - Validate mailbox core functionality under different scheduling policies and allocation methods. |
| 18 | + * - Test comprehensive mailbox operations including send, receive, send-wait, and urgent delivery. |
| 19 | + * - Test core APIs: |
| 20 | + * - rt_mb_init(), rt_mb_detach(), rt_mb_create(), rt_mb_delete(), |
| 21 | + * - rt_mb_send(), rt_mb_send_wait(), rt_mb_urgent(), rt_mb_recv(). |
| 22 | + * |
| 23 | + * Test Scenarios: |
| 24 | + * - Static mailbox initialization and detachment with FIFO and PRIO scheduling. |
| 25 | + * - Dynamic mailbox creation and deletion with FIFO and PRIO scheduling. |
| 26 | + * - Multi-threaded communication using normal send, timed send-wait, and urgent messages in FIFO mode. |
| 27 | + * - Thread coordination using completion flags to validate test sequence execution. |
| 28 | + * |
| 29 | + * Verification Metrics: |
| 30 | + * - All mailbox initialization and creation operations return RT_EOK status. |
| 31 | + * - Mailbox detachment and deletion operations complete successfully without resource leaks. |
| 32 | + * - Sent messages are correctly received with preserved content integrity. |
| 33 | + * - Send-wait operations are verified to respect specified timeout values. |
| 34 | + * - No memory corruption or race conditions during concurrent mailbox access. |
| 35 | + * |
| 36 | + * Dependencies: |
| 37 | + * - Hardware requirements: QEMU emulator or any hardware platform that supports RT-Thread. |
| 38 | + * - Software configuration: |
| 39 | + * - RT_USING_UTEST must be enabled (select "RT-Thread Utestcases" in menuconfig). |
| 40 | + * - RT_UTEST_MAILBOX must be enabled (enable via: RT-Thread Utestcases -> Kernel Core -> Mailbox Test). |
| 41 | + * - Environmental Assumptions: System scheduler working normally. |
| 42 | + * |
| 43 | + * Expected Results: |
| 44 | + * - Final output: "[ PASSED ] [ result ] testcase (core.ipc_mailbox)" |
| 45 | + * - No memory leaks or race condition detections in logs |
| 46 | + * - No assertions triggered during test execution |
10 | 47 | */ |
11 | 48 |
|
12 | 49 | #include <rtthread.h> |
|
0 commit comments