diff options
author | andy wharmby <wharmby@php.net> | 2009-01-23 23:31:48 +0000 |
---|---|---|
committer | andy wharmby <wharmby@php.net> | 2009-01-23 23:31:48 +0000 |
commit | 39c67fe48dcd4ebbe08fb6a8e5e357e5aa10bf86 (patch) | |
tree | 73363a3699ad680ca623b6b66757a6cd9e25b430 | |
parent | 7861cec3efa2346f835d3ec9cacab1f1cbabc788 (diff) | |
download | php-git-39c67fe48dcd4ebbe08fb6a8e5e357e5aa10bf86.tar.gz |
New gzuncompress() test.Tested on WIndows, Linux and Linux 64 bit
-rw-r--r-- | ext/zlib/tests/gzuncompress_basic1.phpt | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/ext/zlib/tests/gzuncompress_basic1.phpt b/ext/zlib/tests/gzuncompress_basic1.phpt new file mode 100644 index 0000000000..fa7f1759e6 --- /dev/null +++ b/ext/zlib/tests/gzuncompress_basic1.phpt @@ -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($data); + +echo "\n-- Basic decompress --\n"; +var_dump(strcmp($data, gzuncompress($compressed))); + + +$length = 3547; +echo "\n-- Calling gzuncompress() with 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 max length of 3547 -- +Result length is 3547 +===DONE===
\ No newline at end of file |