164 free(hello); |
164 free(hello); |
165 ucx_dlist_free(list); |
165 ucx_dlist_free(list); |
166 ucx_dlist_free(copy); |
166 ucx_dlist_free(copy); |
167 } |
167 } |
168 |
168 |
169 UCX_TEST_IMPLEMENT(test_ucx_dlist_qsort) { |
169 UCX_TEST_IMPLEMENT(test_ucx_dlist_sort) { |
170 UcxDlist *list = ucx_dlist_append(NULL, "this"); |
170 UcxDlist *list = ucx_dlist_append(NULL, "this"); |
171 list = ucx_dlist_append(list, "is"); |
171 list = ucx_dlist_append(list, "is"); |
172 list = ucx_dlist_append(list, "a"); |
172 list = ucx_dlist_append(list, "a"); |
173 list = ucx_dlist_append(list, "test"); |
173 list = ucx_dlist_append(list, "test"); |
174 list = ucx_dlist_append(list, "for"); |
174 list = ucx_dlist_append(list, "for"); |
181 expected = ucx_dlist_append(expected, "is"); |
181 expected = ucx_dlist_append(expected, "is"); |
182 expected = ucx_dlist_append(expected, "partial"); |
182 expected = ucx_dlist_append(expected, "partial"); |
183 expected = ucx_dlist_append(expected, "test"); |
183 expected = ucx_dlist_append(expected, "test"); |
184 expected = ucx_dlist_append(expected, "this"); |
184 expected = ucx_dlist_append(expected, "this"); |
185 |
185 |
186 list = ucx_dlist_qsort(list, cmp_string, NULL); |
186 list = ucx_dlist_sort(list, cmp_string, NULL); |
187 |
187 |
188 UCX_TEST_BEGIN |
188 UCX_TEST_BEGIN |
189 UCX_TEST_ASSERT( |
189 UCX_TEST_ASSERT( |
190 ucx_dlist_equals(list, expected, cmp_string, NULL), "failed"); |
190 ucx_dlist_equals(list, expected, cmp_string, NULL), "failed"); |
191 UcxDlist *l = list; |
191 UcxDlist *l = list; |