diff options
Diffstat (limited to 'tests/list.c')
-rw-r--r-- | tests/list.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/list.c b/tests/list.c index e14570f..1d70f33 100644 --- a/tests/list.c +++ b/tests/list.c @@ -1,10 +1,14 @@ // Copyright © Tavian Barnes <tavianator@tavianator.com> // SPDX-License-Identifier: 0BSD -#include "prelude.h" #include "tests.h" + +#include "bfs.h" +#include "diag.h" #include "list.h" +#include <stddef.h> + struct item { int n; struct item *next; @@ -41,7 +45,7 @@ static bool check_list_items(struct list *list, int *array, size_t size) { #define ARRAY(...) (int[]){ __VA_ARGS__ }, countof((int[]){ __VA_ARGS__ }) #define EMPTY() NULL, 0 -bool check_list(void) { +void check_list(void) { struct list l1; SLIST_INIT(&l1); bfs_verify(check_list_items(&l1, EMPTY())); @@ -93,5 +97,6 @@ bool check_list(void) { SLIST_SPLICE(&l1, &l1.head->next, &l2); bfs_verify(check_list_items(&l1, ARRAY(10, 11, 12, 15, 20))); - return true; + // Check the return type of SLIST_POP() + bfs_check(SLIST_POP(&l1)->n == 10); } |