com php-src: make test more flexible to match different compressed strings: ext/zlib/tests/007.phpt ext/zlib/tests/bug51269.phpt ext/zlib/tests/bug55544-win.phpt ext/zlib/tests/gzencode_vari ation2-win32.phpt ext/zlib/tests/ob_001.php t ext/zlib/tests/ob_003.phpt ext/zlib/tests/ob_ 004.phpt

[email protected] (Anatol Belski)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    f258e9b803380e743e40ba45fd7cbd58442a25e8
Author:    Anatol Belski <[email protected]>         Wed, 22 Mar 2017 02:33:38 +0100
Parents:   5096a429a128c53fab05518cf10da3c4fe1ef4e3
Branches:  master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=f258e9b803380e743e40ba45fd7cbd58442a25e8

Log:
make test more flexible to match different compressed strings

particurarly needed with zlib 1.2.11

Changed paths:
  M  ext/zlib/tests/007.phpt
  M  ext/zlib/tests/bug51269.phpt
  M  ext/zlib/tests/bug55544-win.phpt
  M  ext/zlib/tests/gzencode_variation2-win32.phpt
  M  ext/zlib/tests/ob_001.phpt
  M  ext/zlib/tests/ob_003.phpt
  M  ext/zlib/tests/ob_004.phpt


Diff:
diff --git a/ext/zlib/tests/007.phpt b/ext/zlib/tests/007.phpt
index 09207a5..c55d78d 100644
--- a/ext/zlib/tests/007.phpt
+++ b/ext/zlib/tests/007.phpt
@@ -41,11 +41,11 @@ bool(false)
 
 Warning: gzencode(): encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d
 bool(false)
-string(%d) "%s"
-string(%d) "%s"
+string(%d) "%a"
+string(%d) "%a"
 
 Warning: gzencode(): encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d
 bool(false)
-string(%d) "%s"
-string(%d) "%s"
+string(%d) "%a"
+string(%d) "%a"
 Done
diff --git a/ext/zlib/tests/bug51269.phpt b/ext/zlib/tests/bug51269.phpt
index 6b97bac..89ad7b6 100644
--- a/ext/zlib/tests/bug51269.phpt
+++ b/ext/zlib/tests/bug51269.phpt
@@ -14,7 +14,7 @@ header('Vary: Cookie');
 echo 'foo';
 ?>
 --EXPECTF--
-%s
+%a
 --EXPECTHEADERS--
 Vary: Cookie
 Content-Encoding: gzip
diff --git a/ext/zlib/tests/bug55544-win.phpt b/ext/zlib/tests/bug55544-win.phpt
index 03fd6b1..3f9843f 100644
Binary files a/ext/zlib/tests/bug55544-win.phpt and b/ext/zlib/tests/bug55544-win.phpt differ
diff --git a/ext/zlib/tests/gzencode_variation2-win32.phpt b/ext/zlib/tests/gzencode_variation2-win32.phpt
index 7adda31..e46ee23 100644
--- a/ext/zlib/tests/gzencode_variation2-win32.phpt
+++ b/ext/zlib/tests/gzencode_variation2-win32.phpt
@@ -10,6 +10,11 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) {
 if (!extension_loaded("zlib")) {
 	print "skip - ZLIB extension not loaded"; 
 }	 
+
+include 'func.inc';
+if (version_compare(get_zlib_version(), "1.2.11") < 0) {
+	die("skip - at least zlib 1.2.11 required, got " . get_zlib_version());
+}
 ?> 
 --FILE--
 <?php
@@ -34,7 +39,7 @@ var_dump(bin2hex(gzencode($data, -1, FORCE_DEFLATE)));
 *** Testing gzencode() : variation ***
 
 -- Testing with each encoding_mode  --
-string(90) "1f8b080000000000000b735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
-string(90) "1f8b080000000000000b735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
+string(90) "1f8b080000000000000a735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
+string(90) "1f8b080000000000000a735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
 string(66) "789c735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200735808cd"
 ===DONE===
diff --git a/ext/zlib/tests/ob_001.phpt b/ext/zlib/tests/ob_001.phpt
index b074a4f..abf8ce3 100644
--- a/ext/zlib/tests/ob_001.phpt
+++ b/ext/zlib/tests/ob_001.phpt
@@ -16,5 +16,5 @@ HTTP_ACCEPT_ENCODING=gzip
 echo "hi\n";
 ?>
 --EXPECTF--
-‹%s
+‹%a
 
diff --git a/ext/zlib/tests/ob_003.phpt b/ext/zlib/tests/ob_003.phpt
index 7142df7..f3b6088 100644
--- a/ext/zlib/tests/ob_003.phpt
+++ b/ext/zlib/tests/ob_003.phpt
@@ -17,7 +17,7 @@ ini_set("zlib.output_compression", 1);
 echo "hi\n";
 ?>
 --EXPECTF--
-‹%s
+‹%a
 --EXPECTHEADERS--
 Content-Encoding: gzip
 Vary: Accept-Encoding
diff --git a/ext/zlib/tests/ob_004.phpt b/ext/zlib/tests/ob_004.phpt
index f5e6af5..ecbc150 100644
--- a/ext/zlib/tests/ob_004.phpt
+++ b/ext/zlib/tests/ob_004.phpt
@@ -17,7 +17,7 @@ ob_start("ob_gzhandler");
 echo "hi\n";
 ?>
 --EXPECTF--
-‹%s
+‹%a
 --EXPECTHEADERS--
 Content-Encoding: gzip
 Vary: Accept-Encoding
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.