152 free(hello); |
152 free(hello); |
153 ucx_list_free(list); |
153 ucx_list_free(list); |
154 ucx_list_free(copy); |
154 ucx_list_free(copy); |
155 } |
155 } |
156 |
156 |
157 UCX_TEST_IMPLEMENT(test_ucx_list_qsort) { |
157 UCX_TEST_IMPLEMENT(test_ucx_list_sort) { |
158 UcxList *list = ucx_list_append(NULL, "this"); |
158 UcxList *list = ucx_list_append(NULL, "this"); |
159 list = ucx_list_append(list, "is"); |
159 list = ucx_list_append(list, "is"); |
160 list = ucx_list_append(list, "a"); |
160 list = ucx_list_append(list, "a"); |
161 list = ucx_list_append(list, "test"); |
161 list = ucx_list_append(list, "test"); |
162 list = ucx_list_append(list, "for"); |
162 list = ucx_list_append(list, "for"); |
169 expected = ucx_list_append(expected, "is"); |
169 expected = ucx_list_append(expected, "is"); |
170 expected = ucx_list_append(expected, "partial"); |
170 expected = ucx_list_append(expected, "partial"); |
171 expected = ucx_list_append(expected, "test"); |
171 expected = ucx_list_append(expected, "test"); |
172 expected = ucx_list_append(expected, "this"); |
172 expected = ucx_list_append(expected, "this"); |
173 |
173 |
174 list = ucx_list_qsort(list, cmp_string, NULL); |
174 list = ucx_list_sort(list, cmp_string, NULL); |
175 |
175 |
176 UCX_TEST_BEGIN |
176 UCX_TEST_BEGIN |
177 UCX_TEST_ASSERT( |
177 UCX_TEST_ASSERT( |
178 ucx_list_equals(list, expected, cmp_string, NULL), "failed"); |
178 ucx_list_equals(list, expected, cmp_string, NULL), "failed"); |
179 UCX_TEST_END |
179 UCX_TEST_END |