]> git.ozlabs.org Git - ccan/blobdiff - ccan/strset/test/run-prefix.c
endian: add constant versions.
[ccan] / ccan / strset / test / run-prefix.c
index 87ce98fa5b7a31a1104587c2dae4b2455669bac5..e88f2dd0c141ae185b576b93750a50dd335a6f43 100644 (file)
@@ -11,14 +11,14 @@ static bool in_order(const char *value, unsigned int *count)
        int i = atoi(value);
        ok1(*count == i);
        (*count)++;
-       return false;
+       return true;
 }
 
 static bool find_empty(const char *value, char *empty)
 {
        if (value == empty)
                pass("Found empty entry!");
-       return false;
+       return true;
 }
 
 int main(void)
@@ -38,7 +38,7 @@ int main(void)
        }
 
        for (i = 0; i < NUM; i++)
-               strset_set(&set, str[i]);
+               strset_add(&set, str[i]);
 
        /* Nothing */
        sub = strset_prefix(&set, "a");
@@ -70,13 +70,13 @@ int main(void)
 
        /* Everything, *plus* empty string. */
        empty = strdup("");
-       strset_set(&set, empty);
+       strset_add(&set, empty);
 
        sub = strset_prefix(&set, "");
        /* Check we get *our* empty string back! */
        strset_iterate(sub, find_empty, empty);
 
-       strset_destroy(&set);
+       strset_clear(&set);
 
        for (i = 0; i < NUM; i++)
                free(str[i]);