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
37 changes: 37 additions & 0 deletions src/utest/mailbox_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,43 @@
* Date Author Notes
* 2021-09-08 liukang the first version
* 2023-09-15 xqyjlj change stack size in cpu64
* 2025-11-16 ChuanN-sudo add standardized utest documentation block
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

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

🟡 PR Title Format Issue / PR 标题格式问题

English: PR title should follow the format: [module][subsystem] Description using lowercase brackets, not parentheses.

Current title: docs(utest):Add standardized documentation for Mailbox Test

Suggested title: [utest][mailbox] add standardized documentation for mailbox test

中文: PR 标题应遵循格式:使用小写方括号的 [模块][子系统] 描述,而不是圆括号。

当前标题: docs(utest):Add standardized documentation for Mailbox Test

建议标题: [utest][mailbox] add standardized documentation for mailbox test

Copilot generated this review using guidance from repository custom instructions.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

*/

/**
* Test Case Name: IPC Mailbox Test
*
* Test Objectives:
* - Validate mailbox core functionality under different scheduling policies and allocation methods.
* - Test comprehensive mailbox operations including send, receive, send-wait, and urgent delivery.
* - Test core APIs:
* - rt_mb_init(), rt_mb_detach(), rt_mb_create(), rt_mb_delete(),
* - rt_mb_send(), rt_mb_send_wait(), rt_mb_urgent(), rt_mb_recv().
*
* Test Scenarios:
* - Static mailbox initialization and detachment with FIFO and PRIO scheduling.
* - Dynamic mailbox creation and deletion with FIFO and PRIO scheduling.
* - Multi-threaded communication using normal send, timed send-wait, and urgent messages in FIFO mode.
* - Thread coordination using completion flags to validate test sequence execution.
*
* Verification Metrics:
* - All mailbox initialization and creation operations return RT_EOK status.
* - Mailbox detachment and deletion operations complete successfully without resource leaks.
* - Sent messages are correctly received with preserved content integrity.
* - Send-wait operations are verified to respect specified timeout values.
* - No memory corruption or race conditions during concurrent mailbox access.
*
* Dependencies:
* - Hardware requirements: QEMU emulator or any hardware platform that supports RT-Thread.
* - Software configuration:
* - RT_USING_UTEST must be enabled (select "RT-Thread Utestcases" in menuconfig).
* - RT_UTEST_MAILBOX must be enabled (enable via: RT-Thread Utestcases -> Kernel Core -> Mailbox Test).
* - Environmental Assumptions: System scheduler working normally.
*
* Expected Results:
* - Final output: "[ PASSED ] [ result ] testcase (core.ipc_mailbox)"
* - No memory leaks or race condition detections in logs
* - No assertions triggered during test execution
*/

#include <rtthread.h>
Expand Down