Skip to content

Commit b484884

Browse files
carlos-stuartnashif
authored andcommitted
tests: cmsis_rtos_v2: Uncrustify source files
Ran uncrustify on all test source files to ensure a compliant base to work from. Signed-off-by: Carlos Stuart <[email protected]>
1 parent ccf51e2 commit b484884

File tree

7 files changed

+98
-98
lines changed

7 files changed

+98
-98
lines changed

tests/cmsis_rtos_v2/src/event_flags.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ static void thread2(void *arg)
4545

4646
static K_THREAD_STACK_DEFINE(test_stack1, STACKSZ);
4747
static osThreadAttr_t thread1_attr = {
48-
.name = "Thread1",
49-
.stack_mem = &test_stack1,
48+
.name = "Thread1",
49+
.stack_mem = &test_stack1,
5050
.stack_size = STACKSZ,
51-
.priority = osPriorityHigh,
51+
.priority = osPriorityHigh,
5252
};
5353

5454
static K_THREAD_STACK_DEFINE(test_stack2, STACKSZ);
5555
static osThreadAttr_t thread2_attr = {
56-
.name = "Thread2",
57-
.stack_mem = &test_stack2,
56+
.name = "Thread2",
57+
.stack_mem = &test_stack2,
5858
.stack_size = STACKSZ,
59-
.priority = osPriorityHigh,
59+
.priority = osPriorityHigh,
6060
};
6161

6262
static osEventFlagsAttr_t event_flags_attrs = {
@@ -183,10 +183,10 @@ void test_event_from_isr(void *event_id)
183183

184184
static K_THREAD_STACK_DEFINE(test_stack3, STACKSZ);
185185
static osThreadAttr_t thread3_attr = {
186-
.name = "Thread3",
187-
.stack_mem = &test_stack3,
186+
.name = "Thread3",
187+
.stack_mem = &test_stack3,
188188
.stack_size = STACKSZ,
189-
.priority = osPriorityHigh,
189+
.priority = osPriorityHigh,
190190
};
191191

192192
void test_event_flags_isr(void)

tests/cmsis_rtos_v2/src/msgq.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ void message_recv(void)
136136

137137
static K_THREAD_STACK_DEFINE(test_stack, STACKSZ);
138138
osThreadAttr_t thread_attr = {
139-
.name = "send_thread",
140-
.stack_mem = &test_stack,
139+
.name = "send_thread",
140+
.stack_mem = &test_stack,
141141
.stack_size = STACKSZ,
142-
.priority = osPriorityNormal,
142+
.priority = osPriorityNormal,
143143
};
144144

145145
static char __aligned(4) sample_mem[sizeof(struct sample_data) * Q_LEN];

tests/cmsis_rtos_v2/src/mutex.c

+14-14
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#include <kernel.h>
99
#include <cmsis_os2.h>
1010

11-
#define TIMEOUT_TICKS 10
12-
#define STACKSZ 512
11+
#define TIMEOUT_TICKS 10
12+
#define STACKSZ 512
1313

1414
int max_mtx_cnt = CONFIG_CMSIS_V2_MUTEX_MAX_COUNT;
1515
const osMutexAttr_t mutex_attr = {
@@ -40,11 +40,11 @@ void test_max_mutex(void)
4040
mutex_ids[mtx_cnt] = osMutexNew(&mutex_attr);
4141
if (mtx_cnt == max_mtx_cnt) {
4242
zassert_true(mutex_ids[mtx_cnt] == NULL,
43-
"Mutex creation pass unexpectedly after max count");
43+
"Mutex creation pass unexpectedly after max count");
4444
cleanup_max_mutex(mutex_ids);
4545
} else {
4646
zassert_true(mutex_ids[mtx_cnt] != NULL,
47-
"Multiple mutex creation failed before max count");
47+
"Multiple mutex creation failed before max count");
4848
}
4949
}
5050
}
@@ -66,7 +66,7 @@ void test_mutex(void)
6666

6767
name = osMutexGetName(mutex_id);
6868
zassert_true(strcmp(mutex_attr.name, name) == 0,
69-
"Error getting Mutex name");
69+
"Error getting Mutex name");
7070

7171
/* Try to release mutex without obtaining it */
7272
status = osMutexRelease(mutex_id);
@@ -125,7 +125,7 @@ void tThread_entry_lock_timeout(void *arg)
125125

126126
id = osMutexGetOwner((osMutexId_t)arg);
127127
zassert_not_equal(id, osThreadGetId(),
128-
"Unexpectedly, current thread is the mutex owner!");
128+
"Unexpectedly, current thread is the mutex owner!");
129129

130130
/* This delay ensures that the mutex gets released by the other
131131
* thread in the meantime
@@ -142,15 +142,15 @@ void tThread_entry_lock_timeout(void *arg)
142142

143143
static K_THREAD_STACK_DEFINE(test_stack, STACKSZ);
144144
static osThreadAttr_t thread_attr = {
145-
.name = "Mutex_check",
146-
.attr_bits = osThreadDetached,
147-
.cb_mem = NULL,
148-
.cb_size = 0,
149-
.stack_mem = &test_stack,
145+
.name = "Mutex_check",
146+
.attr_bits = osThreadDetached,
147+
.cb_mem = NULL,
148+
.cb_size = 0,
149+
.stack_mem = &test_stack,
150150
.stack_size = STACKSZ,
151-
.priority = osPriorityNormal,
152-
.tz_module = 0,
153-
.reserved = 0
151+
.priority = osPriorityNormal,
152+
.tz_module = 0,
153+
.reserved = 0
154154
};
155155

156156
void test_mutex_lock_timeout(void)

tests/cmsis_rtos_v2/src/semaphore.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ void thread_sema(void *arg)
4747

4848
static K_THREAD_STACK_DEFINE(test_stack, STACKSZ);
4949
static osThreadAttr_t thread_attr = {
50-
.name = "Sema_check",
51-
.attr_bits = osThreadDetached,
52-
.cb_mem = NULL,
53-
.cb_size = 0,
54-
.stack_mem = &test_stack,
50+
.name = "Sema_check",
51+
.attr_bits = osThreadDetached,
52+
.cb_mem = NULL,
53+
.cb_size = 0,
54+
.stack_mem = &test_stack,
5555
.stack_size = STACKSZ,
56-
.priority = osPriorityNormal,
57-
.tz_module = 0,
58-
.reserved = 0
56+
.priority = osPriorityNormal,
57+
.tz_module = 0,
58+
.reserved = 0
5959
};
6060

6161
const osSemaphoreAttr_t sema_attr = {

tests/cmsis_rtos_v2/src/thread_apis.c

+26-26
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@
88
#include <kernel.h>
99
#include <cmsis_os2.h>
1010

11-
#define STACKSZ 512
11+
#define STACKSZ 512
1212

1313
/* This is used to check the thread yield functionality between 2 threads */
1414
static int thread_yield_check;
1515

1616
static K_THREAD_STACK_DEFINE(test_stack1, STACKSZ);
1717
static osThreadAttr_t thread1_attr = {
18-
.name = "Thread1",
19-
.stack_mem = &test_stack1,
18+
.name = "Thread1",
19+
.stack_mem = &test_stack1,
2020
.stack_size = STACKSZ,
21-
.priority = osPriorityHigh,
21+
.priority = osPriorityHigh,
2222
};
2323

2424
static K_THREAD_STACK_DEFINE(test_stack2, STACKSZ);
2525
static osThreadAttr_t thread2_attr = {
26-
.name = "Thread2",
27-
.stack_mem = &test_stack2,
26+
.name = "Thread2",
27+
.stack_mem = &test_stack2,
2828
.stack_size = STACKSZ,
29-
.priority = osPriorityHigh,
29+
.priority = osPriorityHigh,
3030
};
3131

3232
static void thread1(void *argument)
@@ -40,7 +40,7 @@ static void thread1(void *argument)
4040

4141
name = osThreadGetName(thread_id);
4242
zassert_true(strcmp(thread1_attr.name, name) == 0,
43-
"Failed getting Thread name");
43+
"Failed getting Thread name");
4444

4545
/* This thread starts off at a high priority (same as thread2) */
4646
thread_yield_check++;
@@ -72,7 +72,7 @@ static void thread2(void *argument)
7272
thread_array = k_calloc(max_num_threads, sizeof(osThreadId_t));
7373
num_threads = osThreadEnumerate(thread_array, max_num_threads);
7474
zassert_equal(num_threads, 2,
75-
"Incorrect number of cmsis rtos v2 threads");
75+
"Incorrect number of cmsis rtos v2 threads");
7676

7777
for (i = 0; i < num_threads; i++) {
7878
zassert_true(
@@ -85,17 +85,17 @@ static void thread2(void *argument)
8585
}
8686

8787
zassert_equal(osThreadGetState(thread_array[1]), osThreadReady,
88-
"Thread not in ready state");
88+
"Thread not in ready state");
8989
zassert_equal(osThreadGetState(thread_array[0]), osThreadRunning,
90-
"Thread not in running state");
90+
"Thread not in running state");
9191

9292
zassert_equal(osThreadSuspend(thread_array[1]), osOK, "");
9393
zassert_equal(osThreadGetState(thread_array[1]), osThreadBlocked,
94-
"Thread not in blocked state");
94+
"Thread not in blocked state");
9595

9696
zassert_equal(osThreadResume(thread_array[1]), osOK, "");
9797
zassert_equal(osThreadGetState(thread_array[1]), osThreadReady,
98-
"Thread not in ready state");
98+
"Thread not in ready state");
9999

100100
k_free(thread_array);
101101

@@ -115,7 +115,7 @@ void test_thread_apis(void)
115115
zassert_true(id2 != NULL, "Failed creating thread2");
116116

117117
zassert_equal(osThreadGetCount(), 2,
118-
"Incorrect number of cmsis rtos v2 threads");
118+
"Incorrect number of cmsis rtos v2 threads");
119119

120120
do {
121121
osDelay(100);
@@ -129,10 +129,10 @@ static int thread3_state;
129129

130130
static K_THREAD_STACK_DEFINE(test_stack3, STACKSZ);
131131
static osThreadAttr_t thread3_attr = {
132-
.name = "Thread3",
133-
.stack_mem = &test_stack3,
132+
.name = "Thread3",
133+
.stack_mem = &test_stack3,
134134
.stack_size = STACKSZ,
135-
.priority = osPriorityNormal,
135+
.priority = osPriorityNormal,
136136
};
137137

138138
static void thread3(void *argument)
@@ -146,27 +146,27 @@ static void thread3(void *argument)
146146
osThreadSetPriority(id, osPriorityBelowNormal);
147147
rv = osThreadGetPriority(id);
148148
zassert_equal(rv, osPriorityBelowNormal,
149-
"Expected priority to be changed to %d, not %d",
150-
(int)osPriorityBelowNormal, (int)rv);
149+
"Expected priority to be changed to %d, not %d",
150+
(int)osPriorityBelowNormal, (int)rv);
151151

152152
/* Increase the priority of the current thread */
153153
osThreadSetPriority(id, osPriorityAboveNormal);
154154
rv = osThreadGetPriority(id);
155155
zassert_equal(rv, osPriorityAboveNormal,
156-
"Expected priority to be changed to %d, not %d",
157-
(int)osPriorityAboveNormal, (int)rv);
156+
"Expected priority to be changed to %d, not %d",
157+
(int)osPriorityAboveNormal, (int)rv);
158158

159159
/* Restore the priority of the current thread */
160160
osThreadSetPriority(id, prio);
161161
rv = osThreadGetPriority(id);
162162
zassert_equal(rv, prio,
163-
"Expected priority to be changed to %d, not %d",
164-
(int)prio, (int)rv);
163+
"Expected priority to be changed to %d, not %d",
164+
(int)prio, (int)rv);
165165

166166
/* Try to set unsupported priority and assert failure */
167167
status = osThreadSetPriority(id, OsPriorityInvalid);
168168
zassert_true(status == osErrorParameter,
169-
"Something's wrong with osThreadSetPriority!");
169+
"Something's wrong with osThreadSetPriority!");
170170

171171
/* Indication that thread3 is done with its processing */
172172
thread3_state = 1;
@@ -198,12 +198,12 @@ void test_thread_prio(void)
198198
/* Try to set priority to inactive thread and assert failure */
199199
status = osThreadSetPriority(id3, osPriorityNormal);
200200
zassert_true(status == osErrorResource,
201-
"Something's wrong with osThreadSetPriority!");
201+
"Something's wrong with osThreadSetPriority!");
202202

203203
/* Try to terminate inactive thread and assert failure */
204204
status = osThreadTerminate(id3);
205205
zassert_true(status == osErrorResource,
206-
"Something's wrong with osThreadTerminate!");
206+
"Something's wrong with osThreadTerminate!");
207207

208208
thread3_state = 0;
209209
}

0 commit comments

Comments
 (0)