1 #include <freeradius-devel/util/acutest.h>
1127 test_item_t item1a = {
"item1a", { NULL, NULL } };
1128 test_item_t item2a = {
"item2a", { NULL, NULL } };
1129 test_item_t item3a = {
"item3a", { NULL, NULL } };
1131 test_item_t item1b = {
"item1b", { NULL, NULL } };
1132 test_item_t item2b = {
"item2b", { NULL, NULL } };
1133 test_item_t item3b = {
"item3b", { NULL, NULL } };
1194 test_item_t item1a = {
"item1a", { NULL, NULL } };
1195 test_item_t item2a = {
"item2a", { NULL, NULL } };
1196 test_item_t item3a = {
"item3a", { NULL, NULL } };
1198 test_item_t item1b = {
"item1b", { NULL, NULL } };
1199 test_item_t item2b = {
"item2b", { NULL, NULL } };
1200 test_item_t item3b = {
"item3b", { NULL, NULL } };
1256 test_item_t item1a = {
"item1a", { NULL, NULL } };
1257 test_item_t item2a = {
"item2a", { NULL, NULL } };
1258 test_item_t item3a = {
"item3a", { NULL, NULL } };
1260 test_item_t item1b = {
"item1b", { NULL, NULL } };
1261 test_item_t item2b = {
"item2b", { NULL, NULL } };
1262 test_item_t item3b = {
"item3b", { NULL, NULL } };
1314 test_item_t item1a = {
"item1a", { NULL, NULL } };
1315 test_item_t item2a = {
"item2a", { NULL, NULL } };
1316 test_item_t item3a = {
"item3a", { NULL, NULL } };
1318 test_item_t item1b = {
"item1b", { NULL, NULL } };
1319 test_item_t item2b = {
"item2b", { NULL, NULL } };
1320 test_item_t item3b = {
"item3b", { NULL, NULL } };
1379 test_item_t item1a = {
"item1a", { NULL, NULL } };
1380 test_item_t item2a = {
"item2a", { NULL, NULL } };
1381 test_item_t item3a = {
"item3a", { NULL, NULL } };
1383 test_item_t item1b = {
"item1b", { NULL, NULL } };
1384 test_item_t item2b = {
"item2b", { NULL, NULL } };
1385 test_item_t item3b = {
"item3b", { NULL, NULL } };
1442 test_item_t item1b = {
"item1b", { NULL, NULL } };
1443 test_item_t item2b = {
"item2b", { NULL, NULL } };
1444 test_item_t item3b = {
"item3b", { NULL, NULL } };
1471 test_item_t item1a = {
"item1a", { NULL, NULL } };
1472 test_item_t item2a = {
"item2a", { NULL, NULL } };
1473 test_item_t item3a = {
"item3a", { NULL, NULL } };
1751 char const *s =
uctx;
1753 return strcmp(t->
name, s) == 0;
Functions to iterate over a sets and subsets of items in dlists.
void * fr_dcursor_intersect_next(fr_dcursor_t *a, fr_dcursor_t *b)
Return the next item matching the iterator in cursor a and cursor b.
void * fr_dcursor_intersect_head(fr_dcursor_t *a, fr_dcursor_t *b)
Return the first item matching the iterator in cursor a and cursor b.
static void * fr_dcursor_remove(fr_dcursor_t *cursor)
Remove the current item.
static void * fr_dcursor_list_next_peek(fr_dcursor_t *cursor)
Returns the next list item without advancing the cursor.
static void * _fr_dcursor_init(fr_dcursor_t *cursor, fr_dlist_head_t const *head, fr_dcursor_iter_t iter, fr_dcursor_iter_t peek, void const *iter_uctx, fr_dcursor_insert_t insert, fr_dcursor_remove_t remove, void const *mod_uctx, bool is_const)
Setup a cursor to iterate over attribute items in dlists.
return fr_dcursor_filter_next(cursor, eval, uctx)
static int fr_dcursor_append(fr_dcursor_t *cursor, void *v)
Insert a single item at the end of the list.
static void fr_dcursor_copy(fr_dcursor_t *out, fr_dcursor_t const *in)
Copy cursor parameters and state.
static void fr_dcursor_merge(fr_dcursor_t *cursor, fr_dcursor_t *to_append)
Moves items from one cursor to another.
static void * fr_dcursor_tail(fr_dcursor_t *cursor)
Wind cursor to the tail item in the list.
#define fr_dcursor_iter_init(_cursor, _head, _iter, _peek, _uctx)
Initialise a cursor with a custom iterator.
static int fr_dcursor_insert(fr_dcursor_t *cursor, void *v)
Insert directly after the current item.
static void * fr_dcursor_next_peek(fr_dcursor_t *cursor)
Return the next iterator item without advancing the cursor.
#define fr_dcursor_init(_cursor, _head)
Initialise a cursor.
static void fr_dcursor_free_item(fr_dcursor_t *cursor)
talloc_free the current item
static void * fr_dcursor_set_current(fr_dcursor_t *cursor, void *item)
Set the cursor to a specified item.
static void fr_dcursor_free_list(fr_dcursor_t *cursor)
Free the current item and all items after it.
fr_dcursor_eval_t void const * uctx
fr_dcursor_iter_t void * current
fr_dlist_head_t * dlist
Head of the doubly linked list being iterated over.
static int fr_dcursor_prepend(fr_dcursor_t *cursor, void *v)
Insert a single item at the start of the list.
static void * fr_dcursor_next(fr_dcursor_t *cursor)
Advanced the cursor to the next item.
static void * fr_dcursor_replace(fr_dcursor_t *cursor, void *r)
Replace the current item.
void * iter_uctx
to pass to iterator function.
static void * fr_dcursor_head(fr_dcursor_t *cursor)
Rewind cursor to the start of the list.
static void * fr_dcursor_current(fr_dcursor_t *cursor)
Return the item the cursor current points to.
static void test_dcursor_append_3i_end(void)
static void test_intersect_iterator_b(void)
static void * iter_name_check(fr_dlist_head_t *list, void *current, void *uctx)
static void test_dcursor_replace_3i_mid(void)
static void test_dcursor_free(void)
static void test_intersect_iterator_a(void)
static void test_dcursor_merge_empty(void)
static void test_dcursor_prepend_empty(void)
static void test_dcursor_merge_end_b(void)
static void test_dcursor_append_empty(void)
static void test_dcursor_replace_2i_start(void)
static void test_dcursor_free_item(void)
static void test_dcursor_head_tail_null(void)
static void test_dcursor_replace_1i_start(void)
static void test_dcursor_prepend_3i_end(void)
static void test_dcursor_remove_3i_mid(void)
static void test_dcursor_insert_2i_start(void)
static void test_dcursor_copy(void)
static void test_init_2i_start(void)
static void test_dcursor_remove_3i_start(void)
static void test_dcursor_merge_mid_a(void)
static void test_dcursor_wrap_after_tail(void)
static void test_dcursor_append_3i_mid(void)
static void test_filter_no_match(void)
static void test_dcursor_append_1i_start(void)
static void test_dcursor_prepend_2i_start(void)
static void test_intersect_iterator_disjoint(void)
static void test_dcursor_iter_head_reset(void)
static void test_dcursor_tail(void)
static void test_dcursor_head(void)
static void test_dcursor_current_set_invalid(void)
static void test_next(void)
static void test_dcursor_remove_2i(void)
static void test_dcursor_current_set_valid(void)
static void test_dcursor_remove_empty(void)
static void test_intersect_no_iterators(void)
static void test_dcursor_replace_in_empty(void)
static void test_dcursor_insert_1i_start(void)
static bool eval_eq(void const *item, void const *uctx)
static void test_dcursor_head_after_next(void)
static void test_dcursor_merge_start_a_b(void)
static void test_dcursor_head_reset(void)
static void test_dcursor_merge_with_empty(void)
static void test_dcursor_append_2i_start(void)
static void test_dcursor_prepend_3i_mid(void)
static void test_next_wrap(void)
static void test_dcursor_merge_mid_b(void)
static void test_dcursor_replace_3i_end(void)
static void test_init_null_item(void)
Verify internal state is initialised correctly.
static void test_dcursor_insert_into_empty_3(void)
static void test_intersect_differing_lists(void)
static void test_filter_head_next(void)
static void test_dcursor_head_after_tail(void)
static void test_dcursor_prepend_1i_start(void)
static void test_dcursor_append_empty_3(void)
static void test_dcursor_insert_into_empty(void)
static void test_dcursor_remove_1i(void)
static void test_filter_current(void)
static void test_intersect_iterator_ab(void)
static void test_dcursor_insert_3i_mid(void)
static void test_dcursor_insert_3i_end(void)
static void * test_iter(fr_dlist_head_t *list, void *current, UNUSED void *uctx)
static void test_list_init(test_item_list_t *list)
static void test_init_1i_start(void)
static void test_dcursor_merge_end_a(void)
static void test_dcursor_remove_3i_end(void)
static void * fr_dlist_next(fr_dlist_head_t const *list_head, void const *ptr)
Get the next item in a list.
static int fr_dlist_insert_tail(fr_dlist_head_t *list_head, void *ptr)
Insert an item into the tail of a list.
#define fr_dlist_talloc_init(_head, _type, _field)
Initialise the head structure of a doubly linked list.
Head of a doubly linked list.
Entry in a doubly linked list.