diff --git a/tests/common.inc b/tests/common.inc index b78e6a5..9effbd2 100644 --- a/tests/common.inc +++ b/tests/common.inc @@ -1,5 +1,6 @@ # Helper function # Get the MD5 sum of the file open at the filehandle +use Digest::MD5 qw(md5_hex); sub md5fh { my $fh_orig = shift; diff --git a/tests/normal.pl b/tests/normal.pl index 6d0658b..468eeb0 100644 --- a/tests/normal.pl +++ b/tests/normal.pl @@ -7,7 +7,6 @@ use File::Path; use File::Copy; use File::Temp; use IO::Handle; -use Digest::MD5 qw(md5_hex); require("tests/common.inc"); diff --git a/tests/reverse.pl b/tests/reverse.pl index de010cf..cc3f3af 100755 --- a/tests/reverse.pl +++ b/tests/reverse.pl @@ -109,12 +109,19 @@ sub grow { my $max = 9000; for($i=5; $i < $max; $i += 5) { - print($pfh "wwwww") or die("write failed"); + print($pfh "abcde") or die("write failed"); # autoflush should make sure the write goes to the kernel # immediately. Just to be sure, check it here. sizeVerify($vfh, $i) or die("unexpected plain file size"); sizeVerify($cfh, $i+8) or $ok = 0; sizeVerify($dfh, $i) or $ok = 0; + + if(md5fh($vfh) ne md5fh($dfh)) + { + $ok = 0; + print("# content is different, unified diff:\n"); + system("diff -u $plain/grow $decrypted/grow"); + } last unless $ok; }