|
8 | 8 | * 2021-08-28 Sherman the first version |
9 | 9 | * 2023-09-15 xqyjlj change stack size in cpu64 |
10 | 10 | * fix in smp |
| 11 | + * 2025-11-17 Ze-Hou add standardized utest documentation block |
| 12 | + */ |
| 13 | + |
| 14 | +/** |
| 15 | + * Test Case Name: Kernel Core Message Queue Test |
| 16 | + * |
| 17 | + * Test Objectives: |
| 18 | + * - Validate the RT-Thread kernel message queue (rt_messagequeue) functionality |
| 19 | + * - Test static and dynamic message queue creation, initialization, sending, |
| 20 | + * receiving, urgent send, priority send, reset, detach, and delete APIs |
| 21 | + * |
| 22 | + * Test Scenarios: |
| 23 | + * - Initialize a static message queue and verify correct setup |
| 24 | + * - Create a dynamic message queue and verify allocation |
| 25 | + * - Send messages to the queue until full, test blocking and non-blocking send, |
| 26 | + * urgent send, and priority send (if enabled) |
| 27 | + * - Receive messages from the queue, verify order and data integrity, including |
| 28 | + * priority receive (if enabled) |
| 29 | + * - Reset the message queue and verify it is empty |
| 30 | + * - Detach and delete message queues, ensuring resources are released |
| 31 | + * - Use multiple threads to simulate concurrent send/receive operations |
| 32 | + * |
| 33 | + * Verification Metrics: |
| 34 | + * - All uassert assertions pass without failure |
| 35 | + * - Message queues are created, initialized, detached, and deleted successfully |
| 36 | + * - Messages are sent and received in correct order and with correct data |
| 37 | + * - Blocking and non-blocking operations behave as expected |
| 38 | + * - Urgent and priority send/receive functions work correctly (if enabled) |
| 39 | + * |
| 40 | + * Dependencies: |
| 41 | + * - Enable message queue priority (RT-Thread Kernel -> Inter-Thread communication |
| 42 | + * -> Enable message queue priority) |
| 43 | + * - Enable Message Queue Test (RT-Thread Utestcases -> Kernel Core -> Message Queue Test) |
| 44 | + * - Test on any RT-Thread supported platform (e.g., qemu-virt64-riscv) |
| 45 | + * |
| 46 | + * Expected Results: |
| 47 | + * - After executing this test in msh, the expected output should be: |
| 48 | + * "[ PASSED ] [ result ] testcase (core.messagequeue)" |
11 | 49 | */ |
12 | 50 |
|
13 | 51 | #include <rtthread.h> |
|
0 commit comments