diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | tests/test-gc-sha1.c | 14 |
2 files changed, 13 insertions, 7 deletions
@@ -1,5 +1,11 @@ 2019-08-24 Bruno Haible <bruno@clisp.org> + crypto/gc-sha1 tests: Improve output when the test fails. + * tests/test-gc-sha1.c (main): In case of mismatch, print the entire + output. + +2019-08-24 Bruno Haible <bruno@clisp.org> + crypto/gc-sm3: Fix compilation error with --with-libgcrypt. * m4/gc-sm3.m4 (gl_GC_SM3): Test whether libgcrypt supports SM3. Define LIBGCRYPT_HAS_MD_SM3. diff --git a/tests/test-gc-sha1.c b/tests/test-gc-sha1.c index dcfebbd17d..ac97fa16de 100644 --- a/tests/test-gc-sha1.c +++ b/tests/test-gc-sha1.c @@ -52,11 +52,11 @@ main (int argc, char *argv[]) if (memcmp (out, expect, 20) != 0) { size_t i; - printf ("sha1 mismatch. expected:\n"); - for (i = 0; i < 16; i++) + printf ("sha1 test1 mismatch. expected:\n"); + for (i = 0; i < 20; i++) printf ("%02x ", expect[i] & 0xFF); printf ("\ncomputed:\n"); - for (i = 0; i < 16; i++) + for (i = 0; i < 20; i++) printf ("%02x ", out[i] & 0xFF); printf ("\n"); return 1; @@ -72,11 +72,11 @@ main (int argc, char *argv[]) if (memcmp (out, expect, 20) != 0) { size_t i; - printf ("sha1' mismatch. expected:\n"); - for (i = 0; i < 16; i++) + printf ("sha1 test2 mismatch. expected:\n"); + for (i = 0; i < 20; i++) printf ("%02x ", expect[i] & 0xFF); printf ("\ncomputed:\n"); - for (i = 0; i < 16; i++) + for (i = 0; i < 20; i++) printf ("%02x ", out[i] & 0xFF); printf ("\n"); return 1; @@ -107,7 +107,7 @@ main (int argc, char *argv[]) if (memcmp (p, expect, 20) != 0) { size_t i; - printf ("sha1 1 mismatch. expected:\n"); + printf ("sha1 test3 mismatch. expected:\n"); for (i = 0; i < 20; i++) printf ("%02x ", expect[i] & 0xFF); printf ("\ncomputed:\n"); |