#include <string.h>
#include <mLib/hex.h>
+#include <mLib/macros.h>
#include <mLib/testrig.h>
#define NSTATE 16
else putchar('-');
} else {
for (i = 0, printable = 1; i < sz; i++)
- if (!isprint((unsigned char)q[i])) { printable = 0; break; }
+ if (!ISPRINT(q[i])) { printable = 0; break; }
if (printable)
printf("`%s'", q);
else {
/* Next job is to parse the command and flags. */
q = v[1].buf; p = q; q += strcspn(q, "/"); if (*q) *q++ = 0;
for (op = optab; op->name; op++)
- if (!strcmp(op->name, p)) goto found_op;
+ if (STRCMP(op->name, ==, p)) goto found_op;
abort();
found_op:
rc = op->op(ctx, f, src, dest, sz);
/* Check we got the right answer. */
- ok = (rc == rcref && (!destref || !memcmp(dest, destref, sz)));
+ ok = (rc == rcref && (!destref || MEMCMP(dest, ==, destref, sz)));
if (!ok) {
printf("failed test\n");
printf(" state = %d\n", r);