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

1.1       misho       1: --TEST--
                      2: Test function gzseek() by calling it with SEEK_END when reading
                      3: --SKIPIF--
                      4: <?php 
                      5: if (!extension_loaded("zlib")) {
                      6:        print "skip - ZLIB extension not loaded"; 
                      7: }
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11: $f = dirname(__FILE__)."/004.txt.gz";
                     12: $h = gzopen($f, 'r');
                     13: // move 40 bytes 
                     14: echo "move 40 bytes\n";
                     15: gzread($h, 40);
                     16: echo "tell=";
                     17: var_dump(gztell($h));
                     18: echo "move to the end\n";
                     19: var_dump(gzseek( $h, 0, SEEK_END ) );
                     20: echo "tell=";
                     21: var_dump(gztell($h));
                     22: echo "eof=";
                     23: var_dump(gzeof($h));
                     24: //read the next 10
                     25: var_dump(gzread($h, 10));
                     26: gzclose($h);
                     27: ?>
                     28: ===DONE===
                     29: --EXPECTF--
                     30: move 40 bytes
                     31: tell=int(40)
                     32: move to the end
                     33: 
                     34: Warning: gzseek(): SEEK_END is not supported in %s on line %d
                     35: int(-1)
                     36: tell=int(40)
                     37: eof=bool(false)
                     38: string(10) "iny flying"
                     39: ===DONE===

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