Lines Matching refs:head

17 test_empty_list(list_head_t *head) {  in test_empty_list()  argument
21 assert_ptr_null(ql_first(head), "Unexpected element for empty list"); in test_empty_list()
22 assert_ptr_null(ql_last(head, link), in test_empty_list()
26 ql_foreach(t, head, link) { in test_empty_list()
32 ql_reverse_foreach(t, head, link) { in test_empty_list()
39 list_head_t head; in TEST_BEGIN() local
41 ql_new(&head); in TEST_BEGIN()
42 test_empty_list(&head); in TEST_BEGIN()
57 test_entries_list(list_head_t *head, list_t *entries, unsigned nentries) { in test_entries_list() argument
61 assert_c_eq(ql_first(head)->id, entries[0].id, "Element id mismatch"); in test_entries_list()
62 assert_c_eq(ql_last(head, link)->id, entries[nentries-1].id, in test_entries_list()
66 ql_foreach(t, head, link) { in test_entries_list()
72 ql_reverse_foreach(t, head, link) { in test_entries_list()
79 t = ql_next(head, &entries[i], link); in test_entries_list()
82 assert_ptr_null(ql_next(head, &entries[nentries-1], link), in test_entries_list()
85 assert_ptr_null(ql_prev(head, &entries[0], link), "Unexpected element"); in test_entries_list()
87 t = ql_prev(head, &entries[i], link); in test_entries_list()
93 list_head_t head; in TEST_BEGIN() local
97 ql_new(&head); in TEST_BEGIN()
100 ql_tail_insert(&head, &entries[i], link); in TEST_BEGIN()
103 test_entries_list(&head, entries, NENTRIES); in TEST_BEGIN()
108 list_head_t head; in TEST_BEGIN() local
112 ql_new(&head); in TEST_BEGIN()
115 ql_tail_insert(&head, &entries[i], link); in TEST_BEGIN()
119 test_entries_list(&head, entries, NENTRIES-i); in TEST_BEGIN()
120 ql_tail_remove(&head, list_t, link); in TEST_BEGIN()
122 test_empty_list(&head); in TEST_BEGIN()
127 list_head_t head; in TEST_BEGIN() local
131 ql_new(&head); in TEST_BEGIN()
134 ql_head_insert(&head, &entries[NENTRIES-i-1], link); in TEST_BEGIN()
137 test_entries_list(&head, entries, NENTRIES); in TEST_BEGIN()
142 list_head_t head; in TEST_BEGIN() local
146 ql_new(&head); in TEST_BEGIN()
149 ql_head_insert(&head, &entries[NENTRIES-i-1], link); in TEST_BEGIN()
153 test_entries_list(&head, &entries[i], NENTRIES-i); in TEST_BEGIN()
154 ql_head_remove(&head, list_t, link); in TEST_BEGIN()
156 test_empty_list(&head); in TEST_BEGIN()
161 list_head_t head; in TEST_BEGIN() local
165 ql_new(&head); in TEST_BEGIN()
182 ql_tail_insert(&head, f, link); in TEST_BEGIN()
183 ql_before_insert(&head, f, b, link); in TEST_BEGIN()
184 ql_before_insert(&head, f, c, link); in TEST_BEGIN()
187 ql_before_insert(&head, b, a, link); in TEST_BEGIN()
189 ql_before_insert(&head, f, e, link); in TEST_BEGIN()
191 test_entries_list(&head, entries, sizeof(entries)/sizeof(list_t)); in TEST_BEGIN()