]> git.ozlabs.org Git - ccan/blobdiff - ccan/cppmagic/test/run.c
cppmagic: Conditionals
[ccan] / ccan / cppmagic / test / run.c
index fb2bfb9f95450d0354385843be722c462c25a9a2..0f8917d6a4afa5d8e620504a197fd7ae14cec7b8 100644 (file)
@@ -17,7 +17,7 @@ static inline void check1(const char *orig, const char *expand,
 
 int main(void)
 {
-       plan_tests(21);
+       plan_tests(24);
 
        CHECK1(CPPMAGIC_NOTHING(), "");
        CHECK1(CPPMAGIC_GLUE2(a, b), "ab");
@@ -47,6 +47,10 @@ int main(void)
        CHECK1(CPPMAGIC_ISEMPTY(0), "0");
        CHECK1(CPPMAGIC_ISEMPTY(a, b, c), "0");
        
+       CHECK1(CPPMAGIC_IFELSE(0)(abc)(def), "def");
+       CHECK1(CPPMAGIC_IFELSE(1)(abc)(def), "abc");
+       CHECK1(CPPMAGIC_IFELSE(not zero)(abc)(def), "abc");
+
        /* This exits depending on whether all tests passed */
        return exit_status();
 }