diff options
author | Bruno Haible <bruno@clisp.org> | 2018-05-05 17:38:39 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2018-05-05 17:46:16 +0200 |
commit | a0bdcae57f45deb579e421086d3b7040be5351b1 (patch) | |
tree | ad8fc853b885a24d0c7462b8ed06598d0c65f15d /tests/test-md5.c | |
parent | efff1178bc9e79bc21dee9a5c87b12a8a9ecce0a (diff) | |
download | gnulib-a0bdcae57f45deb579e421086d3b7040be5351b1.tar.gz |
md5 tests: Add test for md5_stream.
* tests/test-digest.h: New file.
* tests/test-md5.c: Include test-digest.h.
(main): Invoke test_digest_on_files on 'md5_stream'.
* modules/crypto/md5-tests (Files): Add tests/test-digest.h.
Diffstat (limited to 'tests/test-md5.c')
-rw-r--r-- | tests/test-md5.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test-md5.c b/tests/test-md5.c index 13b6a76a91..71093436c1 100644 --- a/tests/test-md5.c +++ b/tests/test-md5.c @@ -22,7 +22,12 @@ #include "md5.h" #include <stdio.h> +#include <stdlib.h> #include <string.h> +#include <unistd.h> + +#define TESTFILE "test-md5.data" +#include "test-digest.h" int main (void) @@ -63,5 +68,11 @@ main (void) return 1; } + /* Test md5_stream. */ + test_digest_on_files (md5_stream, "md5_stream", 16, + "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04\xe9\x80\x09\x98\xec\xf8\x42\x7e", + "\x0d\x70\x06\xcd\x05\x5e\x94\xcf\x61\x45\x87\xe1\xd2\xae\x0c\x8e", + "\xec\x99\x67\x9b\xff\xc0\xf9\xb0\x6d\x18\x30\x6b\x06\xd6\x56\x23"); + return 0; } |