summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-08-24 17:28:48 +0200
committerBruno Haible <bruno@clisp.org>2019-08-24 17:28:48 +0200
commit06ba5700871cfae584c604dafa93a3e3a4f23048 (patch)
tree1cfcf3f4fc3c25cfe6047bd5829b807b2a69f2da
parentcac148f96e7c2296a14abff6d7130b53e76bfe63 (diff)
downloadgnulib-06ba5700871cfae584c604dafa93a3e3a4f23048.tar.gz
gnulib-06ba5700871cfae584c604dafa93a3e3a4f23048.tar.bz2
crypto/gc-sha1 tests: Improve output when the test fails.
* tests/test-gc-sha1.c (main): In case of mismatch, print the entire output.
-rw-r--r--ChangeLog6
-rw-r--r--tests/test-gc-sha1.c14
2 files changed, 13 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index b126ba9a34..53e5b25a1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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");

Return to:

Send suggestions and report system problems to the System administrator.