diff options
author | Bruno Haible <bruno@clisp.org> | 2019-08-24 17:28:48 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2019-08-24 17:28:48 +0200 |
commit | 06ba5700871cfae584c604dafa93a3e3a4f23048 (patch) | |
tree | 1cfcf3f4fc3c25cfe6047bd5829b807b2a69f2da /tests/test-gc-sha1.c | |
parent | cac148f96e7c2296a14abff6d7130b53e76bfe63 (diff) | |
download | gnulib-06ba5700871cfae584c604dafa93a3e3a4f23048.tar.gz |
crypto/gc-sha1 tests: Improve output when the test fails.
* tests/test-gc-sha1.c (main): In case of mismatch, print the entire
output.
Diffstat (limited to 'tests/test-gc-sha1.c')
-rw-r--r-- | tests/test-gc-sha1.c | 14 |
1 files changed, 7 insertions, 7 deletions
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"); |