X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/blobdiff_plain/7cf5c72a6d353ed5a7e340562c11e54c21c85e5e..c5e0e40378b7e209521d2e9a52f055575a948313:/struct/t/sym-test.c diff --git a/struct/t/sym-test.c b/struct/t/sym-test.c index 264d6a9..dfc2391 100644 --- a/struct/t/sym-test.c +++ b/struct/t/sym-test.c @@ -3,6 +3,7 @@ #include #include +#include "macros.h" #include "sym.h" typedef struct word { @@ -31,7 +32,7 @@ int main(void) buf[strlen(buf) - 1] = 0; p = strtok(buf, " "); - if (strcmp(p, "set") == 0) { + if (STRCMP(p, ==, "set")) { char *k = strtok(0, " "); int i = atoi(strtok(0, " ")); unsigned f; @@ -39,14 +40,14 @@ int main(void) w->i = i; if (!f) n++; - } else if (strcmp(p, "get") == 0) { + } else if (STRCMP(p, ==, "get")) { char *k = strtok(0, " "); word *w = sym_find(&t, k, -1, 0, 0); if (w) printf("%i\n", w->i); else puts("*MISSING*"); - } else if (strcmp(p, "del") == 0) { + } else if (STRCMP(p, ==, "del")) { char *k = strtok(0, " "); word *w = sym_find(&t, k, -1, 0, 0); if (w) { @@ -54,9 +55,9 @@ int main(void) n--; } else puts("*MISSING*"); - } else if (strcmp(p, "count") == 0) { - printf("%i\n", n); - } else if (strcmp(p, "show") == 0) { + } else if (STRCMP(p, ==, "count")) { + printf("%lu\n", (unsigned long)n); + } else if (STRCMP(p, ==, "show")) { sym_iter i; word *w; word **v, **vv;