wharmby         Wed Jan 21 11:39:13 2009 UTC

  Added files:                 
    /php-src/ext/zlib/tests     gzencode_variation2-win32.phpt 

  Modified files:              
    /php-src/ext/zlib/tests     gzencode_variation2.phpt 
  Log:
  New gzencode() test. php6 tets fails currentlly due to #47178. Tested on 
Windows, Linux and Linux 64 bit
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/tests/gzencode_variation2.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/zlib/tests/gzencode_variation2.phpt
diff -u /dev/null php-src/ext/zlib/tests/gzencode_variation2.phpt:1.2
--- /dev/null   Wed Jan 21 11:39:13 2009
+++ php-src/ext/zlib/tests/gzencode_variation2.phpt     Wed Jan 21 11:39:12 2009
@@ -0,0 +1,42 @@
+--TEST--
+Test gzencode() function : variation - verify header contents with all 
encoding modes
+--XFAIL--
+Test will fail until bug #47178 resolved; missing gzip headers whne 
FORCE_DEFLATE specified
+--SKIPIF--
+<?php 
+
+if( substr(PHP_OS, 0, 3) == "WIN" ) {
+  die("skip.. Do not run on Windows");
+}
+
+if (!extension_loaded("zlib")) {
+       print "skip - ZLIB extension not loaded"; 
+}       
+?> 
+--FILE--
+<?php
+/* Prototype  : string gzencode  ( string $data  [, int $level  [, int 
$encoding_mode  ]] )
+ * Description: Gzip-compress a string 
+ * Source code: ext/zlib/zlib.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing gzencode() : variation ***\n";
+
+$data = "A small string to encode\n";
+
+echo "\n-- Testing with each encoding_mode  --\n";
+var_dump(bin2hex(gzencode(b"$data", -1)));
+var_dump(bin2hex(gzencode(b"$data", -1, FORCE_GZIP)));  
+var_dump(bin2hex(gzencode(b"$data", -1, FORCE_DEFLATE)));
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing gzencode() : variation ***
+
+-- Testing with each encoding_mode  --
+unicode(90) 
"1f8b0800000000000003735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
+unicode(90) 
"1f8b0800000000000003735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
+unicode(86) 
"1f8b0800000000000003789c735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200735808cd"
+===DONE===
\ No newline at end of file

http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/tests/gzencode_variation2-win32.phpt?view=markup&rev=1.1
Index: php-src/ext/zlib/tests/gzencode_variation2-win32.phpt
+++ php-src/ext/zlib/tests/gzencode_variation2-win32.phpt
--TEST--
Test gzencode() function : variation - verify header contents with all encoding 
modes
--XFAIL--
Test will fail until bug #47178 resolved; missing gzip headers whne 
FORCE_DEFLATE specified
--SKIPIF--
<?php 

if( substr(PHP_OS, 0, 3) != "WIN" ) {
  die("skip.. only for Windows");
}

if (!extension_loaded("zlib")) {
        print "skip - ZLIB extension not loaded"; 
}        
?> 
--FILE--
<?php
/* Prototype  : string gzencode  ( string $data  [, int $level  [, int 
$encoding_mode  ]] )
 * Description: Gzip-compress a string 
 * Source code: ext/zlib/zlib.c
 * Alias to functions: 
 */

echo "*** Testing gzencode() : variation ***\n";

$data = "A small string to encode\n";

echo "\n-- Testing with each encoding_mode  --\n";
var_dump(bin2hex(gzencode(b"$data", -1)));
var_dump(bin2hex(gzencode(b"$data", -1, FORCE_GZIP)));  
var_dump(bin2hex(gzencode(b"$data", -1, FORCE_DEFLATE)));

?>
===DONE===
--EXPECTF--
*** Testing gzencode() : variation ***

-- Testing with each encoding_mode  --
unicode(90) 
"1f8b080000000000000b735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
unicode(90) 
"1f8b080000000000000b735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
unicode(86) 
"1f8b080000000000000b789c735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200735808cd"
===DONE===


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to