X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fstr_talloc%2Ftest%2Frun.c;h=c8cc6217bd6e5832d2d0cee2a703a80964567d2c;hb=90768177537d783a157c06f79d5919430b563463;hp=2e45aafe2c2a51e30f115af39a0610f865417249;hpb=868412b72b7c83d1fec52d0f71355bc15de2600e;p=ccan diff --git a/ccan/str_talloc/test/run.c b/ccan/str_talloc/test/run.c index 2e45aafe..c8cc6217 100644 --- a/ccan/str_talloc/test/run.c +++ b/ccan/str_talloc/test/run.c @@ -1,9 +1,8 @@ -#include "str_talloc/str_talloc.h" +#include #include #include -#include "str_talloc/str_talloc.c" -#include "tap/tap.h" -#include "str/str.h" +#include +#include /* FIXME: ccanize */ #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) @@ -19,25 +18,25 @@ int main(int argc, char *argv[]) plan_tests(19); split = strsplit(NULL, "hello world", " ", &n); ok1(n == 3); - ok1(streq(split[0], "hello")); - ok1(streq(split[1], "")); - ok1(streq(split[2], "world")); + ok1(!strcmp(split[0], "hello")); + ok1(!strcmp(split[1], "")); + ok1(!strcmp(split[2], "world")); ok1(split[3] == NULL); talloc_free(split); split = strsplit(NULL, "hello world", " ", NULL); - ok1(streq(split[0], "hello")); - ok1(streq(split[1], "")); - ok1(streq(split[2], "world")); + ok1(!strcmp(split[0], "hello")); + ok1(!strcmp(split[1], "")); + ok1(!strcmp(split[2], "world")); ok1(split[3] == NULL); talloc_free(split); split = strsplit(NULL, "hello world", "o ", NULL); - ok1(streq(split[0], "hell")); - ok1(streq(split[1], "")); - ok1(streq(split[2], "")); - ok1(streq(split[3], "w")); - ok1(streq(split[4], "rld")); + ok1(!strcmp(split[0], "hell")); + ok1(!strcmp(split[1], "")); + ok1(!strcmp(split[2], "")); + ok1(!strcmp(split[3], "w")); + ok1(!strcmp(split[4], "rld")); ok1(split[5] == NULL); ctx = split; @@ -46,10 +45,10 @@ int main(int argc, char *argv[]) talloc_free(ctx); str = strjoin(NULL, substrings, ", "); - ok1(streq(str, "far, bar, baz, b, ba, z, ar, ")); + ok1(!strcmp(str, "far, bar, baz, b, ba, z, ar, ")); ctx = str; str = strjoin(ctx, substrings, ""); - ok1(streq(str, "farbarbazbbazar")); + ok1(!strcmp(str, "farbarbazbbazar")); ok1(talloc_parent(str) == ctx); talloc_free(ctx);