X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fstr%2Ftest%2Frun.c;h=a9dacab051e9f28e7601df2778842529ba35e3fa;hb=dfecdec7d1d1fb99cb73182a7d8da0e23074a4b2;hp=20711ad0c0ea29fccd2ec9f20940fe935e8a4793;hpb=9965fc25fcc92dc76d1cd4cf9595dc3dc9ebc586;p=ccan diff --git a/ccan/str/test/run.c b/ccan/str/test/run.c index 20711ad0..a9dacab0 100644 --- a/ccan/str/test/run.c +++ b/ccan/str/test/run.c @@ -1,8 +1,7 @@ -#include "string/string.h" +#include #include #include -#include "string/string.c" -#include "tap/tap.h" +#include /* FIXME: ccanize */ #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) @@ -24,8 +23,6 @@ static char *strdup_rev(const char *s) int main(int argc, char *argv[]) { unsigned int i, j, n; - char **split, *str; - void *ctx; char *strings[NUM_SUBSTRINGS * NUM_SUBSTRINGS]; n = 0; @@ -38,7 +35,7 @@ int main(int argc, char *argv[]) } } - plan_tests(n * n * 5); + plan_tests(n * n * 5 + 3); for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { unsigned int k, identical = 0; @@ -79,5 +76,11 @@ int main(int argc, char *argv[]) } } + ok1(streq(stringify(NUM_SUBSTRINGS), + "((sizeof(substrings) / sizeof(substrings[0])) - 1)")); + ok1(streq(stringify(ARRAY_SIZE(substrings)), + "(sizeof(substrings) / sizeof(substrings[0]))")); + ok1(streq(stringify(i == 0), "i == 0")); + return exit_status(); }