Annotation of embedaddon/php/ext/zlib/tests/gzuncompress_basic1.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test gzuncompress() function : basic functionality 
                      3: --SKIPIF--
                      4: <?php 
                      5: if (!extension_loaded("zlib")) {
                      6:        print "skip - ZLIB extension not loaded"; 
                      7: }       
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11: /* Prototype  : string gzuncompress(string data [, int length])
                     12:  * Description: Unzip a gzip-compressed string 
                     13:  * Source code: ext/zlib/zlib.c
                     14:  * Alias to functions: 
                     15:  */
                     16: 
                     17: include(dirname(__FILE__) . '/data.inc');
                     18: 
                     19: echo "*** Testing gzuncompress() : basic functionality ***\n";
                     20: 
                     21: 
                     22: // Initialise all required variables
                     23: $compressed = gzcompress($data);
                     24: 
                     25: echo "\n-- Basic decompress --\n";
                     26: var_dump(strcmp($data, gzuncompress($compressed)));
                     27: 
                     28: 
                     29: $length = 3547;
                     30: echo "\n-- Calling gzuncompress() with max length of $length --\n";
                     31: echo "Result length is ".  strlen(gzuncompress($compressed, $length)) .  "\n";
                     32: 
                     33: ?>
                     34: ===DONE===
                     35: --EXPECT--
                     36: *** Testing gzuncompress() : basic functionality ***
                     37: 
                     38: -- Basic decompress --
                     39: int(0)
                     40: 
                     41: -- Calling gzuncompress() with max length of 3547 --
                     42: Result length is 3547
                     43: ===DONE===

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