check (stringi_set_find_node (set, "") == NULL);
if (cnt == 0)
- check (stringi_set_first (set) == NULL);
+ {
+ check (stringi_set_first (set) == NULL);
+ free (stringi_set_get_array (set));
+ }
else
{
const struct stringi_set_node *node;
+ char **array;
int *data_copy;
int left;
+ array = stringi_set_get_array (set);
data_copy = xmemdup (data, cnt * sizeof *data);
left = cnt;
for (node = stringi_set_first (set), i = 0; i < cnt;
const char *s = stringi_set_node_get_string (node);
size_t j;
+ check (s == array[i]);
+
for (j = 0; j < left; j++)
if (!strcasecmp (s, make_string (data_copy[j])))
{
}
check (node == NULL);
free (data_copy);
+ free (array);
+
+ array = stringi_set_get_sorted_array (set);
+ for (i = 0; i < cnt; i++)
+ {
+ if (i > 0)
+ check (strcasecmp (array[i - 1], array[i]) < 0);
+ check (stringi_set_contains (set, array[i]));
+ }
+ free (array);
}
}