encode(template, *count);
ok1(streq(value, template));
(*count)++;
- return false;
+ return true;
}
static bool in_order_by_2(const char *value, unsigned int *count)
encode(template, *count);
ok1(streq(value, template));
(*count) += 2;
- return false;
+ return true;
}
static bool dump(const char *value, void *unused)
{
diag("%s", value);
- return false;
+ return true;
}
int main(void)
}
for (i = 0; i < NUM; i++)
- strset_set(&set, str[i]);
+ strset_add(&set, str[i]);
strset_iterate(&set, dump, NULL);
/* Preserve order after deletion. */
for (i = 0; i < NUM; i += 2)
- ok1(strset_clear(&set, str[i]) == str[i]);
+ ok1(strset_del(&set, str[i]) == str[i]);
i = 1;
strset_iterate(&set, in_order_by_2, &i);
for (i = 1; i < NUM; i += 2)
- ok1(strset_clear(&set, str[i]) == str[i]);
+ ok1(strset_del(&set, str[i]) == str[i]);
/* empty traverse. */
strset_iterate(&set, in_order_by_2, (unsigned int *)NULL);