File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed
Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2006-2021 , RT-Thread Development Team
2+ * Copyright (c) 2006-2025 , RT-Thread Development Team
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 *
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2006-2023 , RT-Thread Development Team
2+ * Copyright (c) 2006-2025 , RT-Thread Development Team
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 *
66 * Change Logs:
77 * Date Author Notes
88 * 2023-12-25 Shell the first version
9+ * 2025-11-16 h0bbl3s Add standardized utest documentation block
910 */
11+
12+ /**
13+ * Test Case Name: Kernel Core MT-Safe Kprint Test
14+ *
15+ * Test Objectives:
16+ * - Validate the thread-safety of the rt_kprintf function
17+ *
18+ * Test Scenarios:
19+ * - mtsafe_kprint_tc: Creates 16 concurrent threads, each calling rt_kprintf in a loop to stress test for
20+ * - race conditions and corruptions
21+ *
22+ * Verification Metrics:
23+ * - All 16 threads run to completion (verified by semaphore)
24+ * - The system does not crash or deadlock
25+ * - Console output is not garbled or corrupted
26+ *
27+ * Dependencies:
28+ * - Enable Thread-Safe kprint Test (RT-Thread Utestcases -> Kernel Core -> MT-Safe Kprint Test)
29+ * - RT_USING_THREADSAFE_PRINTF must be enabled (RT-Thread Kernel -> Enable thread safe kernel print service)
30+ * - Note: This test (and thread-safe kprintf) increases scheduler load. The idle thread stack
31+ * - size (RT-Thread Kernel -> The stack size of idle thread) may need to be increased for this test
32+ * - Test on any RT-Thread supported platform
33+ *
34+ * Expected Results:
35+ * - After executing this test in msh each thread prints its id on a single line each loop until it is finished
36+ * - There should be no mixed or overlapping console outputs
37+ * - When complete you should see the output:
38+ * "[ PASSED ] [ result ] testcase (core.mtsafe_kprint)"
39+ */
40+
1041#include <rtthread.h>
1142#include "utest.h"
1243
You can’t perform that action at this time.
0 commit comments