antithread, foreach, grab_file, hashtable, str_talloc: fix _info depends.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 4 Nov 2010 10:22:42 +0000 (20:52 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 4 Nov 2010 10:22:42 +0000 (20:52 +1030)
For str_talloc and grab_file, avoid using ccan/str (it's just for tests).

ccan/antithread/_info
ccan/foreach/_info
ccan/foreach/foreach.c
ccan/grab_file/test/run-grab.c
ccan/hashtable/_info
ccan/str_talloc/test/run.c

index a32c8bc99652df485ea313dc093d79f9f7175b65..a6899c43c053d1525ea8c6a2bfeaa7a6518a66ee 100644 (file)
@@ -90,10 +90,11 @@ int main(int argc, char *argv[])
                return 1;
 
        if (strcmp(argv[1], "depends") == 0) {
                return 1;
 
        if (strcmp(argv[1], "depends") == 0) {
-               printf("ccan/talloc\n");
                printf("ccan/alloc\n");
                printf("ccan/alloc\n");
+               printf("ccan/list\n");
                printf("ccan/noerr\n");
                printf("ccan/read_write_all\n"); /* For tests */
                printf("ccan/noerr\n");
                printf("ccan/read_write_all\n"); /* For tests */
+               printf("ccan/talloc\n");
                return 0;
        }
 
                return 0;
        }
 
index a00ee8b39635a50a0e4ccec313542eb95992416d..c49a9525d9cfc9261be3454f98125b7c8675bbfa 100644 (file)
@@ -63,6 +63,9 @@ int main(int argc, char *argv[])
                return 1;
 
        if (strcmp(argv[1], "depends") == 0) {
                return 1;
 
        if (strcmp(argv[1], "depends") == 0) {
+#if !HAVE_COMPOUND_LITERALS || !HAVE_FOR_LOOP_DECLARATION
+               printf("ccan/list\n");
+#endif
                return 0;
        }
 
                return 0;
        }
 
index 07108b67574cbab76d2371fe97e7875e41fc6ad3..a18842b0979414f105e85a0ca943cbf63cb95517 100644 (file)
@@ -1,10 +1,10 @@
+#if !HAVE_COMPOUND_LITERALS || !HAVE_FOR_LOOP_DECLARATION
 #include <ccan/foreach/foreach.h>
 #include <ccan/list/list.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdarg.h>
 
 #include <ccan/foreach/foreach.h>
 #include <ccan/list/list.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdarg.h>
 
-#if !HAVE_COMPOUND_LITERALS || !HAVE_FOR_LOOP_DECLARATION
 /* This list is normally very short. */
 static LIST_HEAD(iters);
 
 /* This list is normally very short. */
 static LIST_HEAD(iters);
 
index baaf506642134aafe1de920c830c4ab288db2640..67be97c1b7b512778df691fdecd70af4cf7fbaed 100644 (file)
@@ -8,7 +8,6 @@
 #include <ccan/grab_file/grab_file.c>
 #include <ccan/tap/tap.h>
 #include <ccan/str_talloc/str_talloc.h>
 #include <ccan/grab_file/grab_file.c>
 #include <ccan/tap/tap.h>
 #include <ccan/str_talloc/str_talloc.h>
-#include <ccan/str/str.h>
 
 int 
 main(int argc, char *argv[])
 
 int 
 main(int argc, char *argv[])
@@ -21,10 +20,10 @@ main(int argc, char *argv[])
        str = grab_file(NULL, "test/run-grab.c", NULL);
        split = strsplit(NULL, str, "\n", NULL);
        length = strlen(split[0]);
        str = grab_file(NULL, "test/run-grab.c", NULL);
        split = strsplit(NULL, str, "\n", NULL);
        length = strlen(split[0]);
-       ok1(streq(split[0], "/* This is test for grab_file() function"));
+       ok1(!strcmp(split[0], "/* This is test for grab_file() function"));
        for (i = 1; split[i]; i++)      
                length += strlen(split[i]);
        for (i = 1; split[i]; i++)      
                length += strlen(split[i]);
-       ok1(streq(split[i-1], "/* End of grab_file() test */"));
+       ok1(!strcmp(split[i-1], "/* End of grab_file() test */"));
        if (stat("test/run-grab.c", &st) != 0) 
                /* FIXME: ditto */
                if (stat("ccan/grab_file/test/run-grab.c", &st) != 0) 
        if (stat("test/run-grab.c", &st) != 0) 
                /* FIXME: ditto */
                if (stat("ccan/grab_file/test/run-grab.c", &st) != 0) 
index c3c5b9855536829d56cb64713e3d6621b3e3781b..0974c1558e6f8770dbae931675fd8e9577fc638e 100644 (file)
@@ -1,4 +1,5 @@
 #include <string.h>
 #include <string.h>
+#include <stdio.h>
 
 /**
  * hashtable - hash table routines
 
 /**
  * hashtable - hash table routines
@@ -110,6 +111,7 @@ int main(int argc, char *argv[])
                return 1;
 
        if (strcmp(argv[1], "depends") == 0) {
                return 1;
 
        if (strcmp(argv[1], "depends") == 0) {
+               printf("ccan/typesafe_cb\n");
                return 0;
        }
 
                return 0;
        }
 
index 4e1c3d168dcdd475994fb83b251a54c1b9662562..c8cc6217bd6e5832d2d0cee2a703a80964567d2c 100644 (file)
@@ -3,7 +3,6 @@
 #include <stdio.h>
 #include <ccan/str_talloc/str_talloc.c>
 #include <ccan/tap/tap.h>
 #include <stdio.h>
 #include <ccan/str_talloc/str_talloc.c>
 #include <ccan/tap/tap.h>
-#include <ccan/str/str.h>
 
 /* FIXME: ccanize */
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
 
 /* 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);
        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(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(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;
        ok1(split[5] == NULL);
 
        ctx = split;
@@ -46,10 +45,10 @@ int main(int argc, char *argv[])
        talloc_free(ctx);
 
        str = strjoin(NULL, substrings, ", ");
        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, "");
        ctx = str;
        str = strjoin(ctx, substrings, "");
-       ok1(streq(str, "farbarbazbbazar"));
+       ok1(!strcmp(str, "farbarbazbbazar"));
        ok1(talloc_parent(str) == ctx);
        talloc_free(ctx);
 
        ok1(talloc_parent(str) == ctx);
        talloc_free(ctx);