cvs: php-src /ext/zlib/tests bug_34821.phpt
| From: | Michael Wallner | Date: | Tue, 25 Oct 2005 15:17:11 +0000 |
| Subject: | cvs: php-src /ext/zlib/tests bug_34821.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-34777@lists.php.net to get a copy of this message | ||
mike Tue Oct 25 11:17:11 2005 EDT
Modified files:
/php-src/ext/zlib/tests bug_34821.phpt
Log:
- add test case too
http://cvs.php.net/diff.php/php-src/ext/zlib/tests/bug_34821.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/zlib/tests/bug_34821.phpt
diff -u /dev/null php-src/ext/zlib/tests/bug_34821.phpt:1.2
--- /dev/null Tue Oct 25 11:17:11 2005
+++ php-src/ext/zlib/tests/bug_34821.phpt Tue Oct 25 11:17:11 2005
@@ -0,0 +1,41 @@
+--TEST--
+bug 34821
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--FILE--
+<?php
+
+// test 50 bytes to 500k
+$b = array(
+ 50,
+ 500,
+ 5000,
+ 500000,
+// 1000000, // works, but test would take too long
+);
+
+srand(time());
+
+foreach ($b as $size) {
+ $s = '';
+ for ($i = 0; $i <= $size; ++$i) {
+ $s .= chr(rand(0,255));
+ }
+ var_dump($s == gzinflate(gzdeflate($s)));
+ var_dump($s == gzuncompress(gzcompress($s)));
+ var_dump($s == gzinflate(substr(gzencode($s), 10, -8)));
+}
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)