Lines Matching refs:head

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