@@ -68,8 +68,8 @@ bool manipulate_protected_zone(const int thread_delay)
68
68
changing_counter = false ;
69
69
core_util_critical_section_exit ();
70
70
71
- stat = stdio_mutex.unlock ();
72
- TEST_ASSERT_EQUAL (osOK, stat);
71
+ stdio_mutex.unlock ();
72
+
73
73
return result;
74
74
}
75
75
@@ -121,17 +121,15 @@ void test_dual_thread_nolock_lock_thread(Mutex *mutex)
121
121
osStatus stat;
122
122
mutex->lock ();
123
123
124
- stat = mutex->unlock ();
125
- TEST_ASSERT_EQUAL (osOK, stat);
124
+ mutex->unlock ();
126
125
}
127
126
128
127
void test_dual_thread_nolock_trylock_thread (Mutex *mutex)
129
128
{
130
129
bool stat_b = mutex->trylock ();
131
130
TEST_ASSERT_EQUAL (true , stat_b);
132
131
133
- osStatus stat = mutex->unlock ();
134
- TEST_ASSERT_EQUAL (osOK, stat);
132
+ mutex->unlock ();
135
133
}
136
134
137
135
/* * Test dual thread no-lock
@@ -140,13 +138,13 @@ void test_dual_thread_nolock_trylock_thread(Mutex *mutex)
140
138
Given two threads A & B and a mutex
141
139
When thread A creates a mutex and starts thread B
142
140
and thread B calls @a lock and @a unlock
143
- Then returned statuses are osOK
141
+ Then @a lock and @a unlock operations are successfully performed.
144
142
145
143
Test dual thread second thread trylock
146
144
Given two threads A & B and a mutex
147
145
When thread A creates a mutex and starts thread B
148
146
and thread B calls @a trylock and @a unlock
149
- Then returned statuses are true and osOK
147
+ Then @a trylock and @a unlock operations are successfully performed.
150
148
*/
151
149
template <void (*F)(Mutex *)>
152
150
void test_dual_thread_nolock (void )
@@ -183,8 +181,7 @@ void test_dual_thread_lock_unlock(void)
183
181
184
182
thread.start (callback (test_dual_thread_lock_unlock_thread, &mutex));
185
183
186
- stat = mutex.unlock ();
187
- TEST_ASSERT_EQUAL (osOK, stat);
184
+ mutex.unlock ();
188
185
189
186
wait_ms (TEST_DELAY);
190
187
}
@@ -232,15 +229,14 @@ void test_dual_thread_lock(void)
232
229
233
230
wait_ms (TEST_LONG_DELAY);
234
231
235
- stat = mutex.unlock ();
236
- TEST_ASSERT_EQUAL (osOK, stat);
232
+ mutex.unlock ();
237
233
}
238
234
239
235
/* * Test single thread lock recursive
240
236
241
237
Given a mutex and a single running thread
242
238
When thread calls @a lock twice and @a unlock twice on the mutex
243
- Then the returned statuses are osOK
239
+ Then @a lock and @a unlock operations are successfully performed.
244
240
*/
245
241
void test_single_thread_lock_recursive (void )
246
242
{
@@ -251,18 +247,16 @@ void test_single_thread_lock_recursive(void)
251
247
252
248
mutex.lock ();
253
249
254
- stat = mutex.unlock ();
255
- TEST_ASSERT_EQUAL (osOK, stat);
250
+ mutex.unlock ();
256
251
257
- stat = mutex.unlock ();
258
- TEST_ASSERT_EQUAL (osOK, stat);
252
+ mutex.unlock ();
259
253
}
260
254
261
255
/* * Test single thread trylock
262
256
263
257
Given a mutex and a single running thread
264
258
When thread calls @a trylock and @a unlock on the mutex
265
- Then the returned statuses are osOK
259
+ Then @a trylock and @a unlock operations are successfully performed.
266
260
*/
267
261
void test_single_thread_trylock (void )
268
262
{
@@ -271,15 +265,14 @@ void test_single_thread_trylock(void)
271
265
bool stat_b = mutex.trylock ();
272
266
TEST_ASSERT_EQUAL (true , stat_b);
273
267
274
- osStatus stat = mutex.unlock ();
275
- TEST_ASSERT_EQUAL (osOK, stat);
268
+ mutex.unlock ();
276
269
}
277
270
278
271
/* * Test single thread lock
279
272
280
273
Given a mutex and a single running thread
281
274
When thread calls @a lock and @a unlock on the mutex
282
- Then the returned statuses are osOK
275
+ Then @a lock and @a unlock operations are successfully performed.
283
276
*/
284
277
void test_single_thread_lock (void )
285
278
{
@@ -288,8 +281,7 @@ void test_single_thread_lock(void)
288
281
289
282
mutex.lock ();
290
283
291
- stat = mutex.unlock ();
292
- TEST_ASSERT_EQUAL (osOK, stat);
284
+ mutex.unlock ();
293
285
}
294
286
295
287
utest::v1::status_t test_setup (const size_t number_of_cases)
0 commit comments