xref: /openbsd-src/gnu/usr.bin/perl/cpan/Digest-MD5/t/align.t (revision 256a93a44f36679bee503f12e49566c2183f6181)
1# Test that md5 works on unaligned memory blocks
2
3use strict;
4use warnings;
5
6print "1..1\n";
7
8use Digest::MD5 qw(md5_hex);
9
10my $str = "\100" x 20;
11substr($str, 0, 1) = "";  # chopping off first char makes the string unaligned
12
13#use Devel::Peek; Dump($str);
14
15print "not " unless md5_hex($str) eq "c7ebb510e59ee96f404f288d14cc656a";
16print "ok 1\n";
17
18