]> granicus.if.org Git - php/commitdiff
MF51: add adler32 test
authorMichael Wallner <mike@php.net>
Sat, 3 Dec 2005 10:32:42 +0000 (10:32 +0000)
committerMichael Wallner <mike@php.net>
Sat, 3 Dec 2005 10:32:42 +0000 (10:32 +0000)
ext/hash/package.xml
ext/hash/tests/adler32.phpt [new file with mode: 0644]

index 09a243a549906c52f3c978031ac518b8921f0ef0..f4f4a143519267ef683a9a660cd681b673348c18 100644 (file)
@@ -81,6 +81,7 @@ Initial Release
     <file role="test" name="gost.phpt"/>
     <file role="test" name="snefru.phpt"/>
     <file role="test" name="crc32.phpt"/>
+    <file role="test" name="adler32.phpt"/>
    </dir>
   </filelist>
 
diff --git a/ext/hash/tests/adler32.phpt b/ext/hash/tests/adler32.phpt
new file mode 100644 (file)
index 0000000..acfcc2b
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+ADLER32
+--SKIPIF--
+<?php extension_loaded('hash') or die('skip'); ?>
+--FILE--
+<?php
+echo hash('adler32', ''), "\n";
+echo hash('adler32', 'a'), "\n";
+echo hash('adler32', 'abc'), "\n";
+echo hash('adler32', 'message digest'), "\n";
+echo hash('adler32', 'abcdefghijklmnopqrstuvwxyz'), "\n";
+echo hash('adler32', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'), "\n";
+echo hash('adler32', '12345678901234567890123456789012345678901234567890123456789012345678901234567890'), "\n";
+?>
+--EXPECT--
+01000000
+62006200
+27014d02
+86057529
+200b8690
+0c15db8a
+6910b697