diff options
| author | David M. Syzdek <david@syzdek.net> | 2022-01-21 02:58:13 -0900 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2022-01-21 02:58:13 -0900 |
| commit | 595fcb8f1955fc24d614ed8e3eec720f5f2c6a80 (patch) | |
| tree | 074a69392e37dc7a3c939144639fb2b9bc486cc6 /tests | |
| parent | c667b9e76dd4e5f09035bbed008d385aa467ad3d (diff) | |
| download | tinyrad-595fcb8f1955fc24d614ed8e3eec720f5f2c6a80.tar.gz tinyrad-595fcb8f1955fc24d614ed8e3eec720f5f2c6a80.tar.bz2 tinyrad-595fcb8f1955fc24d614ed8e3eec720f5f2c6a80.tar.xz tinyrad-595fcb8f1955fc24d614ed8e3eec720f5f2c6a80.zip | |
tests: resolving compiler warnings
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-array-queue.c | 5 | ||||
| -rw-r--r-- | tests/test-array-stack.c | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/tests/test-array-queue.c b/tests/test-array-queue.c index 0491e0e..691155d 100644 --- a/tests/test-array-queue.c +++ b/tests/test-array-queue.c | |||
| @@ -132,7 +132,6 @@ int main( int argc, char * argv[] ) | |||
| 132 | size_t pos; | 132 | size_t pos; |
| 133 | size_t len; | 133 | size_t len; |
| 134 | size_t list_len; | 134 | size_t list_len; |
| 135 | ssize_t idx; | ||
| 136 | size_t x; | 135 | size_t x; |
| 137 | size_t delta; | 136 | size_t delta; |
| 138 | MyData data[MY_LIST_LEN]; | 137 | MyData data[MY_LIST_LEN]; |
| @@ -250,7 +249,7 @@ int main( int argc, char * argv[] ) | |||
| 250 | }; | 249 | }; |
| 251 | 250 | ||
| 252 | // adds objects to queue | 251 | // adds objects to queue |
| 253 | if ((idx = tinyrad_array_enqueue((void **)&list, &list_len, sizeof(MyData *), &src[x], &realloc)) == -1) | 252 | if (tinyrad_array_enqueue((void **)&list, &list_len, sizeof(MyData *), &src[x], &realloc) == -1) |
| 254 | return(our_error(opts, "failed to enqueue object to queue")); | 253 | return(our_error(opts, "failed to enqueue object to queue")); |
| 255 | }; | 254 | }; |
| 256 | 255 | ||
| @@ -270,7 +269,7 @@ int main( int argc, char * argv[] ) | |||
| 270 | // dequeue data from queue | 269 | // dequeue data from queue |
| 271 | our_verbose(opts, "dequeueing from queue ..."); | 270 | our_verbose(opts, "dequeueing from queue ..."); |
| 272 | while (list_len > 0) | 271 | while (list_len > 0) |
| 273 | if ((objp = tinyrad_array_dequeue(list, &list_len, sizeof(MyData *))) == NULL) | 272 | if (tinyrad_array_dequeue(list, &list_len, sizeof(MyData *)) == NULL) |
| 274 | return(our_error(opts, "unable to dequeue from queue")); | 273 | return(our_error(opts, "unable to dequeue from queue")); |
| 275 | 274 | ||
| 276 | return(0); | 275 | return(0); |
diff --git a/tests/test-array-stack.c b/tests/test-array-stack.c index 3e3a7b4..0e4d82f 100644 --- a/tests/test-array-stack.c +++ b/tests/test-array-stack.c | |||
| @@ -132,7 +132,6 @@ int main( int argc, char * argv[] ) | |||
| 132 | size_t pos; | 132 | size_t pos; |
| 133 | size_t len; | 133 | size_t len; |
| 134 | size_t list_len; | 134 | size_t list_len; |
| 135 | ssize_t idx; | ||
| 136 | size_t x; | 135 | size_t x; |
| 137 | size_t y; | 136 | size_t y; |
| 138 | MyData data[MY_LIST_LEN]; | 137 | MyData data[MY_LIST_LEN]; |
| @@ -250,7 +249,7 @@ int main( int argc, char * argv[] ) | |||
| 250 | }; | 249 | }; |
| 251 | 250 | ||
| 252 | // adds objects to stack | 251 | // adds objects to stack |
| 253 | if ((idx = tinyrad_array_push((void **)&list, &list_len, sizeof(MyData *), &src[x], &realloc)) == -1) | 252 | if (tinyrad_array_push((void **)&list, &list_len, sizeof(MyData *), &src[x], &realloc) == -1) |
| 254 | return(our_error(opts, "failed to push object to stack")); | 253 | return(our_error(opts, "failed to push object to stack")); |
| 255 | }; | 254 | }; |
| 256 | 255 | ||
| @@ -272,7 +271,7 @@ int main( int argc, char * argv[] ) | |||
| 272 | // pop data from stack | 271 | // pop data from stack |
| 273 | our_verbose(opts, "popping from stack ..."); | 272 | our_verbose(opts, "popping from stack ..."); |
| 274 | while (list_len > 0) | 273 | while (list_len > 0) |
| 275 | if ((objp = tinyrad_array_pop(list, &list_len, sizeof(MyData *))) == NULL) | 274 | if (tinyrad_array_pop(list, &list_len, sizeof(MyData *)) == NULL) |
| 276 | return(our_error(opts, "unable to pop from stack")); | 275 | return(our_error(opts, "unable to pop from stack")); |
| 277 | 276 | ||
| 278 | return(0); | 277 | return(0); |
