File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / zlib / tests / gzuncompress_basic1.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:05 2012 UTC (12 years, 4 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--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===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>