Lines Matching full:head
15 test_empty_list(list_head_t *head) in test_empty_list() argument
20 assert_ptr_null(ql_first(head), "Unexpected element for empty list"); in test_empty_list()
21 assert_ptr_null(ql_last(head, link), in test_empty_list()
25 ql_foreach(t, head, link) { in test_empty_list()
31 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()
58 test_entries_list(list_head_t *head, list_t *entries, unsigned nentries) in test_entries_list() argument
63 assert_c_eq(ql_first(head)->id, entries[0].id, "Element id mismatch"); in test_entries_list()
64 assert_c_eq(ql_last(head, link)->id, entries[nentries-1].id, in test_entries_list()
68 ql_foreach(t, head, link) { in test_entries_list()
74 ql_reverse_foreach(t, head, link) { in test_entries_list()
81 t = ql_next(head, &entries[i], link); in test_entries_list()
84 assert_ptr_null(ql_next(head, &entries[nentries-1], link), in test_entries_list()
87 assert_ptr_null(ql_prev(head, &entries[0], link), "Unexpected element"); in test_entries_list()
89 t = ql_prev(head, &entries[i], link); in test_entries_list()
96 list_head_t head; in TEST_BEGIN() local
100 ql_new(&head); in TEST_BEGIN()
103 ql_tail_insert(&head, &entries[i], link); in TEST_BEGIN()
105 test_entries_list(&head, entries, NENTRIES); in TEST_BEGIN()
111 list_head_t head; in TEST_BEGIN() local
115 ql_new(&head); in TEST_BEGIN()
118 ql_tail_insert(&head, &entries[i], link); in TEST_BEGIN()
121 test_entries_list(&head, entries, NENTRIES-i); in TEST_BEGIN()
122 ql_tail_remove(&head, list_t, link); in TEST_BEGIN()
124 test_empty_list(&head); in TEST_BEGIN()
130 list_head_t head; in TEST_BEGIN() local
134 ql_new(&head); in TEST_BEGIN()
137 ql_head_insert(&head, &entries[NENTRIES-i-1], link); in TEST_BEGIN()
139 test_entries_list(&head, entries, NENTRIES); in TEST_BEGIN()
145 list_head_t head; in TEST_BEGIN() local
149 ql_new(&head); in TEST_BEGIN()
152 ql_head_insert(&head, &entries[NENTRIES-i-1], link); in TEST_BEGIN()
155 test_entries_list(&head, &entries[i], NENTRIES-i); in TEST_BEGIN()
156 ql_head_remove(&head, list_t, link); in TEST_BEGIN()
158 test_empty_list(&head); in TEST_BEGIN()
164 list_head_t head; in TEST_BEGIN() local
168 ql_new(&head); in TEST_BEGIN()
185 ql_tail_insert(&head, f, link); in TEST_BEGIN()
186 ql_before_insert(&head, f, b, link); in TEST_BEGIN()
187 ql_before_insert(&head, f, c, link); in TEST_BEGIN()
190 ql_before_insert(&head, b, a, link); in TEST_BEGIN()
192 ql_before_insert(&head, f, e, link); in TEST_BEGIN()
194 test_entries_list(&head, entries, sizeof(entries)/sizeof(list_t)); in TEST_BEGIN()