Skip to content

Commit 79b7230

Browse files
committed
adding utest documentation
1 parent 30e1e5e commit 79b7230

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/utest/atomic_tc.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,34 @@
88
* 2022-07-27 flybreak the first version
99
* 2023-03-21 WangShun add atomic test
1010
* 2023-09-15 xqyjlj change stack size in cpu64
11+
* 2025-11-16 h0bbl3s Add standardized utest documentation block
12+
*/
13+
14+
/**
15+
* Test Case Name: Kernel Core Atomic Operations Test
16+
*
17+
* Test Objectives:
18+
* - Validate the functional correctness of the following RT-Thread core atomic operations:
19+
* - rt_atomic_add, rt_atomic_sub, rt_atomic_or, rt_atomic_xor, rt_atomic_and, rt_atomic_exchange,
20+
* - rt_atomic_flag_test_and_set, rt_atomic_flag_clear, rt_atomic_load, rt_atomic_store,
21+
* - rt_atomic_compare_exchange_strong
22+
* - Verify the thread-safety of rt_atomic_add under multi-threaded contention
23+
*
24+
* Test Scenarios:
25+
* - test_atomic_api: A single-thread functional test checking all core atomic operations
26+
* - test_atomic_add: Three concurrent threads, each incrementing a shared counter using rt_atomic_add
27+
*
28+
* Verification Metrics:
29+
* - All assertions in test_atomic_api must pass
30+
* - The final shared counter value in test_atomic_add must be correct
31+
*
32+
* Dependencies:
33+
* - Enable Atomic Test (RT-Thread Utestcases -> Kernel Core -> Atomic Test)
34+
* - Test on any RT-Thread supported platform
35+
*
36+
* Expected Results
37+
* - After executing this test in msh, the expected output should be:
38+
* "[ PASSED ] [ result ] testcase (core.atomic)"
1139
*/
1240

1341
#include <rtthread.h>

0 commit comments

Comments
 (0)