path: root/ext/zlib/tests/gzseek_variation7.phpt
diff options
authorDave Kelsey <>2009-01-21 15:24:13 (GMT)
committerDave Kelsey <>2009-01-21 15:24:13 (GMT)
commit7d8c189a6dc9ccc58d1b4ccc8a6497fb1d7ba4e9 (patch)
tree13122ddb8874553af36c6e622cf1e65010eb9c9a /ext/zlib/tests/gzseek_variation7.phpt
parent30a0135d184e749759a4370a14171a1fe5621192 (diff)
new tests for zlib extension, tested on windows, linux and linux64
Diffstat (limited to 'ext/zlib/tests/gzseek_variation7.phpt')
1 files changed, 47 insertions, 0 deletions
diff --git a/ext/zlib/tests/gzseek_variation7.phpt b/ext/zlib/tests/gzseek_variation7.phpt
new file mode 100644
index 0000000..aab0834
--- /dev/null
+++ b/ext/zlib/tests/gzseek_variation7.phpt
@@ -0,0 +1,47 @@
+Test function gzseek() by calling it with SEEK_END when writing
+if (!extension_loaded("zlib")) {
+ print "skip - ZLIB extension not loaded";
+$f = "temp3.txt.gz";
+$h = gzopen($f, 'w');
+$str1 = "This is the first line.";
+$str2 = "This is the second line.";
+gzwrite($h, $str1);
+echo "tell=";
+//seek to the end which is not sensible of course.
+echo "move to the end of the file\n";
+var_dump(gzseek($h, 0, SEEK_END));
+echo "tell=";
+gzwrite($h, $str2);
+echo "tell=";
+echo "\nreading the output file\n";
+$h = gzopen($f, 'r');
+echo "\n";
+move to the end of the file
+Warning: gzseek(): SEEK_END is not supported in %s on line %d
+reading the output file
+This is the first line.This is the second line.
+===DONE=== \ No newline at end of file