- remove debug code
authorMichael Wallner <mike@php.net>
Wed, 21 Dec 2005 00:26:16 +0000 (00:26 +0000)
committerMichael Wallner <mike@php.net>
Wed, 21 Dec 2005 00:26:16 +0000 (00:26 +0000)
- fix encodings test

http_encoding_api.c
tests/encodings.phpt

index 53c14d319ac52f26a1397140d3a7b45a572f47d5..c05d3e8096ffca0dd318184a6e6f32d3f62fd867 100644 (file)
@@ -429,7 +429,6 @@ retry_raw_inflate:
                                }
                        break;
                }
-               if (Z_BUF_ERROR == status) DebugBreak();
        } while (Z_BUF_ERROR == status && ++max < HTTP_ENCODING_MAXTRY);
        
        STR_SET(*decoded, NULL);
index 1b44ce5f7ffdc6848c30f1178520d0e70982dc88..98672bf12a20f0414846222b15a6fe4721e5da5f 100644 (file)
@@ -3,7 +3,7 @@ encodings
 --SKIPIF--
 <?php
 include 'skip.inc';
-skipif(!function_exists('http_gzencode'), 'need zlib');
+skipif(!function_exists('http_deflate'), 'need zlib');
 ?>
 --FILE--
 <?php
@@ -19,20 +19,20 @@ for ($i = 0; $i < 1000000; $i++) {
        $s .= chr(rand(0,255));
 }
 
-var_dump($s == http_gzdecode(http_gzencode($s)));
-var_dump($s == http_inflate(http_deflate($s)));
-var_dump($s == http_inflate(http_deflate($s, -1, true)));
+var_dump($s == http_inflate(http_deflate($s, HTTP_DEFLATE_TYPE_ZLIB)));
+var_dump($s == http_inflate(http_deflate($s, HTTP_DEFLATE_TYPE_GZIP)));
+var_dump($s == http_inflate(http_deflate($s, HTTP_DEFLATE_TYPE_RAW)));
 
 if (extension_loaded('zlib')) {
        
        $s = "A simple test string, which won't blow up ext/zlib.\n";
        
-       ($s == http_gzdecode(gzencode($s))) or print "GZIP Failed\n";
+       ($s == http_inflate(gzencode($s))) or print "GZIP Failed\n";
        ($s == http_inflate(gzdeflate($s))) or print "DEFLATE Failed\n";
        ($s == http_inflate(gzcompress($s))) or print "COMPRESS Failed\n";
        
-       ($s == gzinflate(http_deflate($s))) or print "INFLATE Failed\n";
-       ($s == gzuncompress(http_deflate($s, -1, true))) or print "UNCOMPRESS Failed\n";
+       ($s == gzinflate(http_deflate($s, HTTP_DEFLATE_TYPE_RAW))) or print "INFLATE Failed\n";
+       ($s == gzuncompress(http_deflate($s, HTTP_DEFLATE_TYPE_ZLIB))) or print "UNCOMPRESS Failed\n";
 }
 
 echo "Done\n";