wharmby Fri Jan 23 23:31:52 2009 UTC
Modified files:
/php-src/ext/zlib/tests gzuncompress_basic1.phpt
Log:
New gzuncompress() test.Tested on WIndows, Linux and Linux 64 bit
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/tests/gzuncompress_basic1.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/zlib/tests/gzuncompress_basic1.phpt
diff -u /dev/null php-src/ext/zlib/tests/gzuncompress_basic1.phpt:1.2
--- /dev/null Fri Jan 23 23:31:52 2009
+++ php-src/ext/zlib/tests/gzuncompress_basic1.phpt Fri Jan 23 23:31:52 2009
@@ -0,0 +1,43 @@
+--TEST--
+Test gzuncompress() function : basic functionality
+--SKIPIF--
+<?php
+if (!extension_loaded("zlib")) {
+ print "skip - ZLIB extension not loaded";
+}
+?>
+--FILE--
+<?php
+/* Prototype : string gzuncompress(string data [, int length])
+ * Description: Unzip a gzip-compressed string
+ * Source code: ext/zlib/zlib.c
+ * Alias to functions:
+ */
+
+include(dirname(__FILE__) . '/data.inc');
+
+echo "*** Testing gzuncompress() : basic functionality ***\n";
+
+
+// Initialise all required variables
+$compressed = gzcompress(b"$data");
+
+echo "\n-- Basic decompress --\n";
+var_dump(strcmp($data, gzuncompress($compressed)));
+
+
+$length = 3547;
+echo "\n-- Calling gzuncompress() with all max length of $length --\n";
+echo "Result length is ". strlen(gzuncompress($compressed, $length)) . "\n";
+
+?>
+===DONE===
+--EXPECT--
+*** Testing gzuncompress() : basic functionality ***
+
+-- Basic decompress --
+int(0)
+
+-- Calling gzuncompress() with all max length of 3547 --
+Result length is 3547
+===DONE===
\ No newline at end of file
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php