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

1.1       misho       1: --TEST--
                      2: Test function gztell() by calling it with its expected arguments when writing
                      3: --SKIPIF--
                      4: <?php 
                      5: if (!extension_loaded("zlib")) {
                      6:        print "skip - ZLIB extension not loaded"; 
                      7: }
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11: $f = "temp2.txt.gz";
                     12: $h = gzopen($f, 'w');
                     13: $sizes = array(7, 22, 54, 17, 27, 15, 1000);
                     14: // tell should be 7, 29, 83, 100, 127, 142, 1142
                     15: 
                     16: var_dump(gztell($h));
                     17: foreach ($sizes as $size) { 
                     18:    echo "bytes written=".gzwrite($h, str_repeat(b'1', $size))."\n";;
                     19:    echo "tell=".gztell($h)."\n";
                     20: }
                     21: 
                     22: gzclose($h);
                     23: unlink($f);
                     24: ?>
                     25: ===DONE===
                     26: --EXPECT--
                     27: int(0)
                     28: bytes written=7
                     29: tell=7
                     30: bytes written=22
                     31: tell=29
                     32: bytes written=54
                     33: tell=83
                     34: bytes written=17
                     35: tell=100
                     36: bytes written=27
                     37: tell=127
                     38: bytes written=15
                     39: tell=142
                     40: bytes written=1000
                     41: tell=1142
                     42: ===DONE===

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