@@ -73,20 +73,15 @@ void UT_os_bin_sem_create_test()
73
73
osal_id_t sem_ids [OS_MAX_BIN_SEMAPHORES + 1 ];
74
74
75
75
/*-----------------------------------------------------*/
76
- if (!UT_IMPL (OS_BinSemCreate (& sem_ids [0 ], "Good" , 1 , 0 )))
77
- return ;
78
- UT_TEARDOWN (OS_BinSemDelete (sem_ids [0 ]));
79
-
80
- /*-----------------------------------------------------*/
81
- UT_RETVAL (OS_BinSemCreate (NULL , "BinSem1" , 1 , 0 ), OS_INVALID_POINTER , "null pointer arg 1" );
76
+ UT_RETVAL (OS_BinSemCreate (NULL , "BinSem1" , 1 , 0 ), OS_INVALID_POINTER );
82
77
83
78
/*-----------------------------------------------------*/
84
- UT_RETVAL (OS_BinSemCreate (& sem_ids [0 ], NULL , 1 , 0 ), OS_INVALID_POINTER , "null pointer arg 2" );
79
+ UT_RETVAL (OS_BinSemCreate (& sem_ids [0 ], NULL , 1 , 0 ), OS_INVALID_POINTER );
85
80
86
81
/*-----------------------------------------------------*/
87
82
memset (long_sem_name , 'X' , sizeof (long_sem_name ));
88
83
long_sem_name [sizeof (long_sem_name ) - 1 ] = '\0' ;
89
- UT_RETVAL (OS_BinSemCreate (& sem_ids [0 ], long_sem_name , 1 , 0 ), OS_ERR_NAME_TOO_LONG , "name too long" );
84
+ UT_RETVAL (OS_BinSemCreate (& sem_ids [0 ], long_sem_name , 1 , 0 ), OS_ERR_NAME_TOO_LONG );
90
85
91
86
/*-----------------------------------------------------*/
92
87
/* Setup */
@@ -103,8 +98,7 @@ void UT_os_bin_sem_create_test()
103
98
104
99
if (i == OS_MAX_BIN_SEMAPHORES ) /* setup was successful */
105
100
{
106
- UT_RETVAL (OS_BinSemCreate (& sem_ids [OS_MAX_BIN_SEMAPHORES ], "OneTooMany" , 1 , 0 ), OS_ERR_NO_FREE_IDS ,
107
- "no free ids" );
101
+ UT_RETVAL (OS_BinSemCreate (& sem_ids [OS_MAX_BIN_SEMAPHORES ], "OneTooMany" , 1 , 0 ), OS_ERR_NO_FREE_IDS );
108
102
}
109
103
110
104
/* Reset test environment */
@@ -113,7 +107,7 @@ void UT_os_bin_sem_create_test()
113
107
/*-----------------------------------------------------*/
114
108
if (UT_SETUP (OS_BinSemCreate (& sem_ids [0 ], "DUPLICATE" , 1 , 0 )))
115
109
{
116
- UT_RETVAL (OS_BinSemCreate (& sem_ids [0 ], "DUPLICATE" , 1 , 0 ), OS_ERR_NAME_TAKEN , "duplicate name" );
110
+ UT_RETVAL (OS_BinSemCreate (& sem_ids [0 ], "DUPLICATE" , 1 , 0 ), OS_ERR_NAME_TAKEN );
117
111
118
112
/* Reset test environment */
119
113
UT_TEARDOWN (OS_BinSemDelete (sem_ids [0 ]));
@@ -139,11 +133,7 @@ void UT_os_bin_sem_delete_test()
139
133
osal_id_t bin_sem_id ;
140
134
141
135
/*-----------------------------------------------------*/
142
- if (!UT_IMPL (OS_BinSemDelete (OS_OBJECT_ID_UNDEFINED )))
143
- return ;
144
-
145
- /*-----------------------------------------------------*/
146
- UT_RETVAL (OS_BinSemDelete (UT_OBJID_INCORRECT ), OS_ERR_INVALID_ID , "invalid id arg" );
136
+ UT_RETVAL (OS_BinSemDelete (UT_OBJID_INCORRECT ), OS_ERR_INVALID_ID );
147
137
148
138
/*-----------------------------------------------------*/
149
139
if (UT_SETUP (OS_BinSemCreate (& bin_sem_id , "DeleteTest" , 1 , 0 )))
@@ -166,11 +156,7 @@ void UT_os_bin_sem_flush_test()
166
156
osal_id_t bin_sem_id ;
167
157
168
158
/*-----------------------------------------------------*/
169
- if (!UT_IMPL (OS_BinSemFlush (OS_OBJECT_ID_UNDEFINED )))
170
- return ;
171
-
172
- /*-----------------------------------------------------*/
173
- UT_RETVAL (OS_BinSemFlush (UT_OBJID_INCORRECT ), OS_ERR_INVALID_ID , "invalid id arg" );
159
+ UT_RETVAL (OS_BinSemFlush (UT_OBJID_INCORRECT ), OS_ERR_INVALID_ID );
174
160
175
161
/*----------------------------------------------------*/
176
162
if (UT_SETUP (OS_BinSemCreate (& bin_sem_id , "FlushTest" , 1 , 0 )))
@@ -194,11 +180,7 @@ void UT_os_bin_sem_give_test()
194
180
osal_id_t bin_sem_id ;
195
181
196
182
/*-----------------------------------------------------*/
197
- if (!UT_IMPL (OS_BinSemGive (OS_OBJECT_ID_UNDEFINED )))
198
- return ;
199
-
200
- /*-----------------------------------------------------*/
201
- UT_RETVAL (OS_BinSemGive (UT_OBJID_INCORRECT ), OS_ERR_INVALID_ID , "invalid id arg" );
183
+ UT_RETVAL (OS_BinSemGive (UT_OBJID_INCORRECT ), OS_ERR_INVALID_ID );
202
184
203
185
/*-----------------------------------------------------*/
204
186
if (UT_SETUP (OS_BinSemCreate (& bin_sem_id , "GiveTest" , 1 , 0 )))
@@ -223,11 +205,7 @@ void UT_os_bin_sem_take_test()
223
205
osal_id_t bin_sem_id ;
224
206
225
207
/*-----------------------------------------------------*/
226
- if (!UT_IMPL (OS_BinSemTake (OS_OBJECT_ID_UNDEFINED )))
227
- return ;
228
-
229
- /*-----------------------------------------------------*/
230
- UT_RETVAL (OS_BinSemTake (UT_OBJID_INCORRECT ), OS_ERR_INVALID_ID , "invalid id arg" );
208
+ UT_RETVAL (OS_BinSemTake (UT_OBJID_INCORRECT ), OS_ERR_INVALID_ID );
231
209
232
210
/*-----------------------------------------------------*/
233
211
if (UT_SETUP (OS_BinSemCreate (& bin_sem_id , "TakeTest" , 1 , 0 )))
@@ -251,16 +229,12 @@ void UT_os_bin_sem_timed_wait_test()
251
229
osal_id_t bin_sem_id ;
252
230
253
231
/*-----------------------------------------------------*/
254
- if (!UT_IMPL (OS_BinSemTimedWait (OS_OBJECT_ID_UNDEFINED , 1000 )))
255
- return ;
256
-
257
- /*-----------------------------------------------------*/
258
- UT_RETVAL (OS_BinSemTimedWait (UT_OBJID_INCORRECT , 1000 ), OS_ERR_INVALID_ID , "invalid id arg" );
232
+ UT_RETVAL (OS_BinSemTimedWait (UT_OBJID_INCORRECT , 1000 ), OS_ERR_INVALID_ID );
259
233
260
234
/*-----------------------------------------------------*/
261
235
if (UT_SETUP (OS_BinSemCreate (& bin_sem_id , "TimedWait" , 1 , 0 )) && UT_SETUP (OS_BinSemTake (bin_sem_id )))
262
236
{
263
- UT_RETVAL (OS_BinSemTimedWait (bin_sem_id , 1000 ), OS_SEM_TIMEOUT , "semtake timed out" );
237
+ UT_RETVAL (OS_BinSemTimedWait (bin_sem_id , 1000 ), OS_SEM_TIMEOUT );
264
238
UT_TEARDOWN (OS_BinSemDelete (bin_sem_id ));
265
239
}
266
240
@@ -288,22 +262,18 @@ void UT_os_bin_sem_get_id_by_name_test()
288
262
char long_sem_name [UT_OS_NAME_BUFF_SIZE ];
289
263
290
264
/*-----------------------------------------------------*/
291
- if (!UT_IMPL (OS_BinSemGetIdByName (NULL , "InvalidName" )))
292
- return ;
265
+ UT_RETVAL (OS_BinSemGetIdByName (NULL , "InvalidName" ), OS_INVALID_POINTER );
293
266
294
267
/*-----------------------------------------------------*/
295
- UT_RETVAL (OS_BinSemGetIdByName (NULL , "InvalidName" ), OS_INVALID_POINTER , "invalid ptr arg 1" );
296
-
297
- /*-----------------------------------------------------*/
298
- UT_RETVAL (OS_BinSemGetIdByName (& bin_sem_id , NULL ), OS_INVALID_POINTER , "invalid ptr arg 2" );
268
+ UT_RETVAL (OS_BinSemGetIdByName (& bin_sem_id , NULL ), OS_INVALID_POINTER );
299
269
300
270
/*-----------------------------------------------------*/
301
271
memset (long_sem_name , 'Y' , sizeof (long_sem_name ));
302
272
long_sem_name [sizeof (long_sem_name ) - 1 ] = '\0' ;
303
- UT_RETVAL (OS_BinSemGetIdByName (& bin_sem_id , long_sem_name ), OS_ERR_NAME_TOO_LONG , "name too long" );
273
+ UT_RETVAL (OS_BinSemGetIdByName (& bin_sem_id , long_sem_name ), OS_ERR_NAME_TOO_LONG );
304
274
305
275
/*-----------------------------------------------------*/
306
- UT_RETVAL (OS_BinSemGetIdByName (& bin_sem_id , "NameNotFound" ), OS_ERR_NAME_NOT_FOUND , "name not found" );
276
+ UT_RETVAL (OS_BinSemGetIdByName (& bin_sem_id , "NameNotFound" ), OS_ERR_NAME_NOT_FOUND );
307
277
308
278
/*-----------------------------------------------------*/
309
279
if (UT_SETUP (OS_BinSemCreate (& bin_sem_id , "GetIDByName" , 1 , 0 )))
@@ -328,16 +298,12 @@ void UT_os_bin_sem_get_info_test()
328
298
OS_bin_sem_prop_t bin_sem_prop ;
329
299
330
300
/*-----------------------------------------------------*/
331
- if (!UT_IMPL (OS_BinSemGetInfo (OS_OBJECT_ID_UNDEFINED , & bin_sem_prop )))
332
- return ;
333
-
334
- /*-----------------------------------------------------*/
335
- UT_RETVAL (OS_BinSemGetInfo (UT_OBJID_INCORRECT , & bin_sem_prop ), OS_ERR_INVALID_ID , "invalid id" );
301
+ UT_RETVAL (OS_BinSemGetInfo (UT_OBJID_INCORRECT , & bin_sem_prop ), OS_ERR_INVALID_ID );
336
302
337
303
/*-----------------------------------------------------*/
338
304
if (UT_SETUP (OS_BinSemCreate (& bin_sem_id , "GetInfo" , 1 , 0 )))
339
305
{
340
- UT_RETVAL (OS_BinSemGetInfo (bin_sem_id , NULL ), OS_INVALID_POINTER , "invalid ptr" );
306
+ UT_RETVAL (OS_BinSemGetInfo (bin_sem_id , NULL ), OS_INVALID_POINTER );
341
307
UT_TEARDOWN (OS_BinSemDelete (bin_sem_id ));
342
308
}
343
309
0 commit comments