+2018-06-24 Bruno Haible <bruno@clisp.org>
+
+ af_alg tests: Add another test.
+ * tests/test-digest.h (test_digest_on_files): Also check a large file
+ with a skipped header.
+ * tests/test-md5.c: Include macros.h.
+ * tests/test-sha1.c: Likewise.
+ * tests/test-sha256.c: Likewise.
+ * tests/test-sha512.c: Likewise.
+ * modules/crypto/md5-tests (Files): Add tests/macros.h.
+ * modules/crypto/sha1-tests (Files): Likewise.
+ * modules/crypto/sha256-tests (Files): Likewise.
+ * modules/crypto/sha512-tests (Files): Likewise.
+
2018-06-24 Pádraig Brady <P@draigBrady.com>
maint: clarify comments about sticky EOF
int pass;
unlink (TESTFILE);
- for (pass = 0; pass < 4; pass++)
+ for (pass = 0; pass < 5; pass++)
{
{
FILE *fp = fopen (TESTFILE, "wb");
case 0:
/* Nothing to do for the empty file. */
break;
+ case 2:
+ /* Fill the small file, with some header that will be skipped. */
+ fputs ("ABCD", fp);
+ FALLTHROUGH;
case 1:
/* Fill the small file. */
fputs ("The quick brown fox jumps over the lazy dog.\n", fp);
break;
- case 2:
- /* Fill the small file, with some header that will be skipped. */
- fputs ("ABCDThe quick brown fox jumps over the lazy dog.\n", fp);
- break;
+ case 4:
+ /* Fill the large file, with some header that will be skipped. */
+ fputs ("ABCD", fp);
+ FALLTHROUGH;
case 3:
/* Fill the large file (8 MiB). */
{
{
case 0: expected = expected_for_empty_file; break;
case 1: case 2: expected = expected_for_small_file; break;
- case 3: expected = expected_for_large_file; break;
+ case 3: case 4: expected = expected_for_large_file; break;
default: abort ();
}
switch (pass)
{
case 2:
+ case 4:
{
char header[4];
if (fread (header, 1, sizeof (header), fp) != sizeof (header))