24 #include <freeradius-devel/util/acutest.h>
25 #include <freeradius-devel/util/acutest_helpers.h>
59 TEST_CASE(
"Two items - Linking is correct running forwards");
72 TEST_CASE(
"Two items - Linking is correct running backwards");
85 TEST_CASE(
"Two items - Old list is really empty");
100 TEST_CASE(
"One item - Linking is correct running forwards");
108 TEST_CASE(
"One item - Linking is correct running backwards");
116 TEST_CASE(
"One item - Old list is really empty");
148 TEST_CASE(
"Three items - Linking is correct running forwards");
156 TEST_CASE(
"Three items - Linking is correct running backwards");
172 unsigned int count = 0;
#define TEST_CHECK_LEN(_got, _exp)
#define TEST_CHECK_STRCMP(_got, _exp)
Doubly linked list implementation.
#define fr_dlist_init(_head, _type, _field)
Initialise the head structure of a doubly linked list.
static void * fr_dlist_next(fr_dlist_head_t const *list_head, void const *ptr)
Get the next item in a list.
static unsigned int fr_dlist_num_elements(fr_dlist_head_t const *head)
Return the number of elements in the dlist.
static void * fr_dlist_tail(fr_dlist_head_t const *list_head)
Return the TAIL item of a list or NULL if the list is empty.
static void * fr_dlist_head(fr_dlist_head_t const *list_head)
Return the HEAD item of a list or NULL if the list is empty.
static int fr_dlist_insert_tail(fr_dlist_head_t *list_head, void *ptr)
Insert an item into the tail of a list.
static int fr_dlist_move(fr_dlist_head_t *list_dst, fr_dlist_head_t *list_src)
Merge two lists, inserting the source at the tail of the destination.
static void fr_dlist_entry_move(fr_dlist_t *dst, fr_dlist_t *src)
Link in a sublist before the current entry.
static void * fr_dlist_remove(fr_dlist_head_t *list_head, void *ptr)
Remove an item from the list.
static void * fr_dlist_prev(fr_dlist_head_t const *list_head, void const *ptr)
Get the previous item in a list.
#define fr_dlist_foreach_safe(_list_head, _type, _iter)
Iterate over the contents of a list allowing for removals.
Head of a doubly linked list.
Entry in a doubly linked list.
TEST_CHECK_RET((int) count,(int) 3)
static void test_dlist_move(void)
static void test_dlist_foreach_safe(void)
static void test_dlist_entry_move(void)