]> git.ozlabs.org Git - ccan/blobdiff - ccan/strset/test/run-iterate-const.c
endian: add constant versions.
[ccan] / ccan / strset / test / run-iterate-const.c
index 42a1d73552b9541d19297770ad65bf9706e7b650..9f2b13e2634914231c3e2ff721da30ba171b070c 100644 (file)
@@ -9,7 +9,7 @@ static bool find_string(const char *str, const char *cmp)
 {
        if (strcmp(str, cmp) == 0)
                found = true;
-       return false;
+       return true;
 }
 
 int main(void)
@@ -19,11 +19,11 @@ int main(void)
        plan_tests(3);
 
        strset_init(&set);
-       ok1(strset_set(&set, "hello"));
-       ok1(strset_set(&set, "world"));
+       ok1(strset_add(&set, "hello"));
+       ok1(strset_add(&set, "world"));
        strset_iterate(&set, find_string, (const char *)"hello");
        ok1(found);
-       strset_destroy(&set);
+       strset_clear(&set);
 
        /* This exits depending on whether all tests passed */
        return exit_status();