Deploy the new <ctype.h> and `foocmp' macros from mLib.
[catacomb] / symm / hash.h
index 3d0c117..5b2e7fb 100644 (file)
 
 #ifdef TEST_RIG
 
+#include <mLib/macros.h>
 #include <mLib/quis.h>
 #include <mLib/testrig.h>
 
@@ -178,7 +179,7 @@ static int vrf_##pre(dstr *v, const test_type *msgty)                       \
       sz -= i;                                                         \
     }                                                                  \
     pre##_done(&ctx, d.buf);                                           \
-    if (memcmp(d.buf, v[1].buf, PRE##_HASHSZ) != 0) {                  \
+    if (MEMCMP(d.buf, !=, v[1].buf, PRE##_HASHSZ)) {                   \
       printf("\nfail:\n\tstep = %i\n\tinput = ", *ip);                 \
       msgty->dump(&v[0], stdout);                                      \
       printf("\n\texpected = ");                                       \
@@ -222,7 +223,7 @@ static int vrf_##pre##_rep(dstr *v)                                 \
   while (n--) pre##_hash(&ctx, p, len);                                        \
   pre##_done(&ctx, d.buf);                                             \
                                                                        \
-  if (memcmp(d.buf, v[2].buf, PRE##_HASHSZ) != 0) {                    \
+  if (MEMCMP(d.buf, !=, v[2].buf, PRE##_HASHSZ)) {                     \
     printf("\nfail:\n\tinput = `%s'\n\treps = `%i'\n\texpected = ",    \
             v[0].buf, *(int *)v[1].buf);                               \
     type_hex.dump(&v[2], stdout);                                      \