X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/blobdiff_plain/776d2da28318443431563b68c2807eb0c29c49fa..3618811496a6d131fd4bffa19e262c521d39e819:/test/testrig.c diff --git a/test/testrig.c b/test/testrig.c index c85276f..c7dea67 100644 --- a/test/testrig.c +++ b/test/testrig.c @@ -34,6 +34,7 @@ #include #include "dstr.h" +#include "macros.h" #include "report.h" #include "quis.h" #include "testrig.h" @@ -99,7 +100,7 @@ again: /* --- Skip leading whitespace --- */ - while (isspace((unsigned char)ch)) + while (ISSPACE(ch)) ch = getc(fp); /* --- Trap some special characters --- */ @@ -163,7 +164,7 @@ again: case '`': goto done; default: - if (isspace((unsigned char)ch)) + if (ISSPACE(ch)) goto done; } if (ch == '\\') { @@ -328,7 +329,7 @@ int test_do(const test_suite suites[], FILE *fp, test_results *results) goto done; } - if (strcmp(tok.buf, "SUITE") == 0) { + if (STRCMP(tok.buf, ==, "SUITE")) { t = gettok(fp); if (t != TOK_WORD) { moan("expected ; found `%s'", decode(t)); @@ -339,7 +340,7 @@ int test_do(const test_suite suites[], FILE *fp, test_results *results) chunks = 0; break; } - if (strcmp(tok.buf, ss->name) == 0) { + if (STRCMP(tok.buf, ==, ss->name)) { chunks = ss->chunks; break; } @@ -354,7 +355,7 @@ int test_do(const test_suite suites[], FILE *fp, test_results *results) for (cch = chunks; ; cch++) { if (!cch->name) goto skip_chunk; - if (strcmp(tok.buf, cch->name) == 0) + if (STRCMP(tok.buf, ==, cch->name)) break; } @@ -479,7 +480,7 @@ void test_run(int argc, char *argv[], if (i >= argc - 1) break; p = argv[++i]; - if (strcmp(p, "--") == 0) { + if (STRCMP(p, ==, "--")) { i++; break; }