X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/ac82eac807a9818e676c316f8afeab5cff2572cd..141c12847a1c2f8cc8db03d420551584e689fb87:/symm/hash.h diff --git a/symm/hash.h b/symm/hash.h index 3d0c1179..5b2e7fb8 100644 --- a/symm/hash.h +++ b/symm/hash.h @@ -138,6 +138,7 @@ #ifdef TEST_RIG +#include #include #include @@ -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); \