|
8 | 8 | * 2021-09.01 luckyzjq the first version |
9 | 9 | * 2023-09-15 xqyjlj change stack size in cpu64 |
10 | 10 | */ |
| 11 | + |
| 12 | +/** |
| 13 | + * Test Case Name: RT-Thread Mutex Functional and Scheduling Validation |
| 14 | + * Test Objectives: |
| 15 | + * - Verify correctness of static and dynamic mutex operations |
| 16 | + * - Validate priority inheritance, recursive locking, timeout handling, and error cases |
| 17 | + * - Test core mutex APIs: rt_mutex_init/detach, rt_mutex_create/delete, |
| 18 | + * rt_mutex_take/trytake/release, and related thread scheduling functions |
| 19 | + * Test Scenarios: |
| 20 | + * - Mutex acquisition under contention with multi-thread scheduling |
| 21 | + * - Try-take on locked mutex, timeout-based take, recursive take sequence |
| 22 | + * - Priority inheritance when high-priority threads are blocked by lower-priority holders |
| 23 | + * - Behavior differences between static and dynamic mutexes |
| 24 | + * - Mutex release error handling, invalid release, and cleanup |
| 25 | + * Verification Metrics: |
| 26 | + * - Correct return codes for all mutex operations (RT_EOK, timeouts, error states) |
| 27 | + * - Proper priority inheritance and restoration during contention |
| 28 | + * - Expected thread wake-up and state transition behavior |
| 29 | + * - Successful thread synchronization via _sync_flag |
| 30 | + * Dependencies: |
| 31 | + * - RT-Thread kernel with IPC and mutex support enabled |
| 32 | + * - Heap availability when testing dynamic mutex creation |
| 33 | + * - Scheduler operating normally with multi-thread preemption |
| 34 | + * - Accurate system tick for timeout and delay validation |
| 35 | + * Expected Results: |
| 36 | + * - All mutex APIs behave according to RT-Thread specifications |
| 37 | + * - Static and dynamic mutex tests complete successfully |
| 38 | + * - Priority inversion resolved via priority inheritance |
| 39 | + * - Console/log output indicates all UTEST cases pass |
| 40 | + */ |
| 41 | + |
11 | 42 | #define __RT_IPC_SOURCE__ |
12 | 43 |
|
13 | 44 | #include <rtthread.h> |
|
0 commit comments