]> git.ozlabs.org Git - ccan/blobdiff - ccan/str/test/run.c
str: add stringify()
[ccan] / ccan / str / test / run.c
index f35d75d6ea4dc53e8ccb01349dbd519ef6b32739..a9dacab051e9f28e7601df2778842529ba35e3fa 100644 (file)
@@ -35,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;
@@ -76,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();
 }