]> git.ozlabs.org Git - ccan/blobdiff - ccan/strset/test/run-hibit.c
endian: add constant versions.
[ccan] / ccan / strset / test / run-hibit.c
index 2ea158dd9ad6ad77cb4d17866201b18f4d455e48..82f4c9225147e1d5f05358e6ec38a9d53afaaa5c 100644 (file)
@@ -19,7 +19,7 @@ static bool in_order(const char *value, unsigned int *count)
        encode(template, *count);
        ok1(streq(value, template));
        (*count)++;
        encode(template, *count);
        ok1(streq(value, template));
        (*count)++;
-       return false;
+       return true;
 }
 
 static bool in_order_by_2(const char *value, unsigned int *count)
 }
 
 static bool in_order_by_2(const char *value, unsigned int *count)
@@ -28,13 +28,13 @@ static bool in_order_by_2(const char *value, unsigned int *count)
        encode(template, *count);
        ok1(streq(value, template));
        (*count) += 2;
        encode(template, *count);
        ok1(streq(value, template));
        (*count) += 2;
-       return false;
+       return true;
 }
 
 static bool dump(const char *value, void *unused)
 {
        diag("%s", value);
 }
 
 static bool dump(const char *value, void *unused)
 {
        diag("%s", value);
-       return false;
+       return true;
 }
 
 int main(void)
 }
 
 int main(void)
@@ -53,7 +53,7 @@ int main(void)
        }
 
        for (i = 0; i < NUM; i++)
        }
 
        for (i = 0; i < NUM; i++)
-               strset_set(&set, str[i]);
+               strset_add(&set, str[i]);
 
        strset_iterate(&set, dump, NULL);
 
 
        strset_iterate(&set, dump, NULL);
 
@@ -63,13 +63,13 @@ int main(void)
 
        /* Preserve order after deletion. */
        for (i = 0; i < NUM; i += 2)
 
        /* 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)
 
        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);
 
        /* empty traverse. */
        strset_iterate(&set, in_order_by_2, (unsigned int *)NULL);