Skip to content

Commit 11b001e

Browse files
committed
adding utest documentation
1 parent 79b7230 commit 11b001e

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

src/utest/atomic_tc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
*

src/utest/mtsafe_kprint_tc.c

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,43 @@
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

0 commit comments

Comments
 (0)