aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tests/test-array-queue.c
diff options
context:
space:
mode:
authorDavid M. Syzdek <david@syzdek.net>2022-03-08 17:22:25 -0900
committerDavid M. Syzdek <david@syzdek.net>2022-03-08 17:22:25 -0900
commit8a9bbec87523b98af1da3ed43ed03436b0ef04b1 (patch)
treecf1b7504bcaac44b5fd63a4ddb6fa95e4a523b32 /tests/test-array-queue.c
parentcc98d826f549fb77b9f4a90afdea726cf15a39f3 (diff)
downloadtinyrad-8a9bbec87523b98af1da3ed43ed03436b0ef04b1.tar.gz
tinyrad-8a9bbec87523b98af1da3ed43ed03436b0ef04b1.tar.bz2
tinyrad-8a9bbec87523b98af1da3ed43ed03436b0ef04b1.tar.xz
tinyrad-8a9bbec87523b98af1da3ed43ed03436b0ef04b1.zip
tests: replacing our_error() with trutils_error()
Diffstat (limited to 'tests/test-array-queue.c')
-rw-r--r--tests/test-array-queue.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test-array-queue.c b/tests/test-array-queue.c
index e5b979f..25575ea 100644
--- a/tests/test-array-queue.c
+++ b/tests/test-array-queue.c
@@ -222,7 +222,7 @@ int main( int argc, char * argv[] )
222 { 222 {
223 for(; (pos > 0); pos--) 223 for(; (pos > 0); pos--)
224 free(data[pos-1].name); 224 free(data[pos-1].name);
225 return(our_error(opts, NULL, "out of virtual memory")); 225 return(trutils_error(opts, NULL, "out of virtual memory"));
226 }; 226 };
227 }; 227 };
228 228
@@ -242,26 +242,26 @@ int main( int argc, char * argv[] )
242 if ((x % 4) == 3) 242 if ((x % 4) == 3)
243 { 243 {
244 if ((objp = tinyrad_array_dequeue(list, &list_len, sizeof(MyData *))) == NULL) 244 if ((objp = tinyrad_array_dequeue(list, &list_len, sizeof(MyData *))) == NULL)
245 return(our_error(opts, NULL, "unable to dequeue from queue")); 245 return(trutils_error(opts, NULL, "unable to dequeue from queue"));
246 if ((strcasecmp(src[x/4]->name, (*objp)->name))) 246 if ((strcasecmp(src[x/4]->name, (*objp)->name)))
247 return(our_error(opts, NULL, "str of dequeued object is incorrect")); 247 return(trutils_error(opts, NULL, "str of dequeued object is incorrect"));
248 }; 248 };
249 249
250 // adds objects to queue 250 // adds objects to queue
251 if (tinyrad_array_enqueue((void **)&list, &list_len, sizeof(MyData *), &src[x], &realloc) == -1) 251 if (tinyrad_array_enqueue((void **)&list, &list_len, sizeof(MyData *), &src[x], &realloc) == -1)
252 return(our_error(opts, NULL, "failed to enqueue object to queue")); 252 return(trutils_error(opts, NULL, "failed to enqueue object to queue"));
253 }; 253 };
254 254
255 255
256 // loop through queue and verify data 256 // loop through queue and verify data
257 trutils_verbose(opts, "verifing queue ..."); 257 trutils_verbose(opts, "verifing queue ...");
258 if (list_len != ((MY_LIST_LEN / 4) * 3)) 258 if (list_len != ((MY_LIST_LEN / 4) * 3))
259 return(our_error(opts, NULL, "queue length is incorrect")); 259 return(trutils_error(opts, NULL, "queue length is incorrect"));
260 delta = MY_LIST_LEN - list_len; 260 delta = MY_LIST_LEN - list_len;
261 for(x = delta; (x < MY_LIST_LEN); x++) 261 for(x = delta; (x < MY_LIST_LEN); x++)
262 { 262 {
263 if ((strcmp(src[x]->name, list[list_len-x+delta-1]->name))) 263 if ((strcmp(src[x]->name, list[list_len-x+delta-1]->name)))
264 return(our_error(opts, NULL, "queue data does not match test data")); 264 return(trutils_error(opts, NULL, "queue data does not match test data"));
265 }; 265 };
266 266
267 267
@@ -269,7 +269,7 @@ int main( int argc, char * argv[] )
269 trutils_verbose(opts, "dequeueing from queue ..."); 269 trutils_verbose(opts, "dequeueing from queue ...");
270 while (list_len > 0) 270 while (list_len > 0)
271 if (tinyrad_array_dequeue(list, &list_len, sizeof(MyData *)) == NULL) 271 if (tinyrad_array_dequeue(list, &list_len, sizeof(MyData *)) == NULL)
272 return(our_error(opts, NULL, "unable to dequeue from queue")); 272 return(trutils_error(opts, NULL, "unable to dequeue from queue"));
273 273
274 return(0); 274 return(0);
275} 275}