• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:head

21  * SPDX-License-Identifier: curl
59 struct Curl_llist_element *head; variable
71 * 2: list head will be NULL
77 fail_unless(llist.head == NULL, "list head should initiate to NULL");
88 * 2: list head will hold the data "unusedData_case1"
89 * 3: list tail will be the same as list head
92 Curl_llist_insert_next(&llist, llist.head, &unusedData_case1, &case1_list);
96 /* test that the list head data holds my unusedData */
97 fail_unless(llist.head->ptr == &unusedData_case1,
98 "head ptr should be first entry");
100 fail_unless(llist.tail == llist.head,
101 "tail and head should be the same");
106 * list has 1 element, adding one element after the head
108 * 1: the element next to head should be our newly created element
112 Curl_llist_insert_next(&llist, llist.head,
114 fail_unless(llist.head->next->ptr == &unusedData_case3,
115 "the node next to head is not getting set correctly");
116 fail_unless(llist.tail->ptr == &unusedData_case3,
124 * 1: the element next to head should be our newly created element
128 Curl_llist_insert_next(&llist, llist.head,
130 fail_unless(llist.head->next->ptr == &unusedData_case2,
131 "the node next to head is not getting set correctly");
133 fail_unless(llist.tail->ptr != &unusedData_case2,
140 * list has >1 element, removing head
143 * 2: head will be the head->next
144 * 3: "new" head's previous will be NULL
147 head = llist.head;
148 abort_unless(head, "llist.head is NULL");
149 element_next = head->next;
152 Curl_llist_remove(&llist, llist.head, NULL);
154 fail_unless(Curl_llist_count(&llist) == (llist_size-1),
156 fail_unless(llist.head == element_next,
157 "llist new head not modified properly");
158 abort_unless(llist.head, "llist.head is NULL");
159 fail_unless(llist.head->prev == NULL,
160 "new head previous not set to null");
164 * removing non head element, with list having >=2 elements
169 * 2: element->previous->next will be element->next
170 * 3: element->next->previous will be element->previous
172 Curl_llist_insert_next(&llist, llist.head, &unusedData_case3,
177 to_remove = llist.head->next;
179 element_next = to_remove->next;
180 element_prev = to_remove->prev;
182 fail_unless(element_prev->next == element_next,
183 "element previous->next is not being adjusted");
185 fail_unless(element_next->prev == element_prev,
186 "element next->previous is not being adjusted");
193 * 2: element->previous->next will be element->next ;tested
194 * 3: element->next->previous will be element->previous ;tested
195 * 4: list->tail will be tail->previous
199 element_prev = to_remove->prev;
206 * removing head with list having 1 element
209 * 2: list head will be null
213 to_remove = llist.head;
215 fail_unless(llist.head == NULL,
216 "llist head is not NULL while the llist is empty");