1 #include <ccan/autodata/autodata.h>
2 /* Include the C files directly. */
3 #include <ccan/autodata/autodata.c>
4 #include <ccan/tap/tap.h>
6 AUTODATA_TYPE(autostrings, char);
8 AUTODATA(autostrings, "hello");
9 AUTODATA(autostrings, "world");
15 int i, hello = -1, world = -1, helper = -1;
17 /* This is how many tests you plan to run */
20 table = autodata_get(autostrings, &num);
23 for (i = 0; i < num; i++) {
24 if (strcmp(table[i], "hello") == 0)
26 else if (strcmp(table[i], "world") == 0)
28 else if (strcmp(table[i], "helper") == 0)
31 fail("Unknown entry %s", table[i]);
39 /* This exits depending on whether all tests passed */