From: Pierre Joye Date: Sat, 2 Jun 2007 15:35:34 +0000 (+0000) Subject: - enable tests even when an external GD is used. Latest releases X-Git-Tag: php-5.2.4RC1~453 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70650810adb74f6811d0094170d9e31a7876728e;p=php - enable tests even when an external GD is used. Latest releases (2.0.34 or 2.0.35) work. --- diff --git a/ext/gd/tests/bug19366.phpt b/ext/gd/tests/bug19366.phpt index c83d816c15..2832f72645 100644 --- a/ext/gd/tests/bug19366.phpt +++ b/ext/gd/tests/bug19366.phpt @@ -1,9 +1,8 @@ --TEST-- Bug #19366 (gdimagefill() function crashes (fixed in bundled libgd)) --SKIPIF-- - --FILE-- --FILE-- --EXPECT-- diff --git a/ext/gd/tests/bug24155.phpt b/ext/gd/tests/bug24155.phpt index a7cf9ef73a..43d34b7177 100644 --- a/ext/gd/tests/bug24155.phpt +++ b/ext/gd/tests/bug24155.phpt @@ -1,13 +1,11 @@ --TEST-- Bug #24155 (gdImageRotate270 rotation problem). --SKIPIF-- - --FILE-- --FILE-- --EXPECT-- 000000111111101010 -111111111111111111 +111111111111111111 diff --git a/ext/gd/tests/bug27582_1.phpt b/ext/gd/tests/bug27582_1.phpt index b85f7457e0..28db15a74f 100644 --- a/ext/gd/tests/bug27582_1.phpt +++ b/ext/gd/tests/bug27582_1.phpt @@ -3,7 +3,6 @@ Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill colo --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- 45) --SKIPIF-- - --FILE-- --FILE-- --FILE-- +--FILE-- + +--EXPECTF-- +gd-png: fatal libpng error: Read Error: truncated data +gd-png error: setjmp returns error condition 2 +Warning: imagecreatefrompng(): '%sbug39780.png' is not a valid PNG file in /%s on line %d +bool(false) \ No newline at end of file diff --git a/ext/gd/tests/createfromgd2.phpt b/ext/gd/tests/createfromgd2.phpt index 98b078ea59..e43d1b865b 100644 --- a/ext/gd/tests/createfromgd2.phpt +++ b/ext/gd/tests/createfromgd2.phpt @@ -3,7 +3,6 @@ imagecreatefromgd2 --SKIPIF-- --FILE-- --FILE-- --FILE-- +--FILE-- +"); +} + +//write header +$c = 0; +fputs($fp, chr($c), 1); +fputs($fp, $c, 1); + +//write width = 2^32 / 4 + 1 +$c = 0x84; +fputs($fp, chr($c), 1); +$c = 0x80; +fputs($fp, chr($c), 1); +fputs($fp, chr($c), 1); +fputs($fp, chr($c), 1); +$c = 0x01; +fputs($fp, chr($c), 1); + +/*write height = 4*/ +$c = 0x04; +fputs($fp, chr($c), 1); + +/*write some data to cause overflow*/ +for ($i=0; $i<10000; $i++) { + fwrite($fp, chr($c), 1); +} + +fclose($fp); +$im = imagecreatefromwbmp($filename); +unlink($filename); +?> +--EXPECTF-- +gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully + +Warning: imagecreatefromwbmp(): '%s_tmp.wbmp' is not a valid WBMP file in %s on line %d diff --git a/ext/gd/tests/gif2gd.phpt b/ext/gd/tests/gif2gd.phpt index 75291777d8..17ec158cb3 100644 --- a/ext/gd/tests/gif2gd.phpt +++ b/ext/gd/tests/gif2gd.phpt @@ -1,13 +1,11 @@ --TEST-- gif --> gd1/gd2 conversion test --SKIPIF-- - gd1/gd2 conversion test echo "GIF to GD1 conversion: "; echo imagegd(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test.gd1") ? 'ok' : 'failed'; echo "\n"; - + echo "GIF to GD2 conversion: "; echo imagegd2(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test.gd2") ? 'ok' : 'failed'; echo "\n"; - + @unlink($cwd . "/test.gd1"); @unlink($cwd . "/test.gd2"); ?> diff --git a/ext/gd/tests/gif2jpg.phpt b/ext/gd/tests/gif2jpg.phpt index efea3525cf..5f32c35960 100644 --- a/ext/gd/tests/gif2jpg.phpt +++ b/ext/gd/tests/gif2jpg.phpt @@ -1,13 +1,11 @@ --TEST-- gif --> jpeg conversion test --SKIPIF-- - jpeg conversion test echo "GIF to JPEG conversion: "; echo imagejpeg(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.jpeg") ? 'ok' : 'failed'; echo "\n"; - + @unlink($cwd . "/test_gif.jpeg"); ?> --EXPECT-- diff --git a/ext/gd/tests/gif2png.phpt b/ext/gd/tests/gif2png.phpt index 6ac99bb22f..3b8beca249 100644 --- a/ext/gd/tests/gif2png.phpt +++ b/ext/gd/tests/gif2png.phpt @@ -1,13 +1,11 @@ --TEST-- gif --> png conversion test --SKIPIF-- - png conversion test echo "GIF to PNG conversion: "; echo imagepng(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.png") ? 'ok' : 'failed'; echo "\n"; - + @unlink($cwd . "/test_gif.png"); ?> --EXPECT-- diff --git a/ext/gd/tests/imagefilter.phpt b/ext/gd/tests/imagefilter.phpt index 9857b53a00..b3855d66f2 100644 --- a/ext/gd/tests/imagefilter.phpt +++ b/ext/gd/tests/imagefilter.phpt @@ -1,13 +1,11 @@ --TEST-- imagefilter() function test --SKIPIF-- - --FILE-- --FILE-- png conversion test --SKIPIF-- - png conversion test echo "PNG to JPEG conversion: "; echo imagejpeg(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test_jpeg.jpeg") ? 'ok' : 'failed'; echo "\n"; - + echo "Generated JPEG to PNG conversion: "; echo imagepng(imagecreatefromjpeg($cwd . "/test_jpeg.jpeg"), $cwd . "/test_jpng.png") ? 'ok' : 'failed'; echo "\n"; - + echo "JPEG to PNG conversion: "; echo imagepng(imagecreatefromjpeg($cwd . "/conv_test.jpeg"), $cwd . "/test_png.png") ? 'ok' : 'failed'; echo "\n"; - + echo "Generated PNG to JPEG conversion: "; echo imagejpeg(imagecreatefrompng($cwd . "/test_png.png"), $cwd . "/test_pjpeg.jpeg") ? 'ok' : 'failed'; echo "\n"; - + @unlink($cwd . "/test_jpeg.jpeg"); @unlink($cwd . "/test_jpng.png"); @unlink($cwd . "/test_png.png"); diff --git a/ext/gd/tests/jpg2gd.phpt b/ext/gd/tests/jpg2gd.phpt index 24d1940faf..805ec79834 100644 --- a/ext/gd/tests/jpg2gd.phpt +++ b/ext/gd/tests/jpg2gd.phpt @@ -1,13 +1,11 @@ --TEST-- jpeg <--> gd1/gd2 conversion test --SKIPIF-- - gd1/gd2 conversion test echo "JPEG to GD1 conversion: "; echo imagegd(imagecreatefromjpeg($cwd . "/conv_test.jpeg"), $cwd . "/test.gd1") ? 'ok' : 'failed'; echo "\n"; - + echo "JPEG to GD2 conversion: "; echo imagegd2(imagecreatefromjpeg($cwd . "/conv_test.jpeg"), $cwd . "/test.gd2") ? 'ok' : 'failed'; echo "\n"; - + echo "GD1 to JPEG conversion: "; echo imagejpeg(imagecreatefromgd($cwd . "/test.gd1"), $cwd . "/test_gd1.jpeg") ? 'ok' : 'failed'; echo "\n"; - + echo "GD2 to JPEG conversion: "; echo imagejpeg(imagecreatefromgd2($cwd . "/test.gd2"), $cwd . "/test_gd2.jpeg") ? 'ok' : 'failed'; echo "\n"; - + @unlink($cwd . "/test.gd1"); @unlink($cwd . "/test.gd2"); @unlink($cwd . "/test_gd1.jpeg"); diff --git a/ext/gd/tests/libgd00086.phpt b/ext/gd/tests/libgd00086.phpt index 60f28107c8..4c909343ca 100644 --- a/ext/gd/tests/libgd00086.phpt +++ b/ext/gd/tests/libgd00086.phpt @@ -1,9 +1,9 @@ --TEST-- libgd #86 (Possible infinite loop in imagecreatefrompng) --SKIPIF-- - --FILE-- +--FILE-- + +--EXPECTF-- +gd-png: fatal libpng error: Read Error: truncated data +gd-png error: setjmp returns error condition 1 + +Warning: imagecreatefrompng(): '%slibgd00086.png' is not a valid PNG file in %s on line %d +bool(false) diff --git a/ext/gd/tests/png2gd.phpt b/ext/gd/tests/png2gd.phpt index d74e888d6c..65ca505aeb 100644 --- a/ext/gd/tests/png2gd.phpt +++ b/ext/gd/tests/png2gd.phpt @@ -1,13 +1,11 @@ --TEST-- png <--> gd1/gd2 conversion test --SKIPIF-- - gd1/gd2 conversion test echo "PNG to GD1 conversion: "; echo imagegd(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test.gd1") ? 'ok' : 'failed'; echo "\n"; - + echo "PNG to GD2 conversion: "; echo imagegd2(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test.gd2") ? 'ok' : 'failed'; echo "\n"; - + echo "GD1 to PNG conversion: "; echo imagepng(imagecreatefromgd($cwd . "/test.gd1"), $cwd . "/test_gd1.png") ? 'ok' : 'failed'; echo "\n"; - + echo "GD2 to PNG conversion: "; echo imagepng(imagecreatefromgd2($cwd . "/test.gd2"), $cwd . "/test_gd2.png") ? 'ok' : 'failed'; echo "\n"; - + @unlink($cwd . "/test.gd1"); @unlink($cwd . "/test.gd2"); @unlink($cwd . "/test_gd1.png"); diff --git a/ext/gd/tests/pngcomp.phpt b/ext/gd/tests/pngcomp.phpt index 1974610d35..3fd7b57055 100644 --- a/ext/gd/tests/pngcomp.phpt +++ b/ext/gd/tests/pngcomp.phpt @@ -1,13 +1,11 @@ --TEST-- png compression test --SKIPIF-- - --EXPECT-- diff --git a/ext/gd/tests/xpm2gd.phpt b/ext/gd/tests/xpm2gd.phpt index 9c6cca4eb9..e70a13f379 100644 --- a/ext/gd/tests/xpm2gd.phpt +++ b/ext/gd/tests/xpm2gd.phpt @@ -1,13 +1,11 @@ --TEST-- xpm --> gd1/gd2 conversion test --SKIPIF-- - gd1/gd2 conversion test echo "XPM to GD1 conversion: "; echo imagegd(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test.gd1") ? 'ok' : 'failed'; echo "\n"; - + echo "XPM to GD2 conversion: "; echo imagegd2(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test.gd2") ? 'ok' : 'failed'; echo "\n"; - + @unlink($cwd . "/test.gd1"); @unlink($cwd . "/test.gd2"); ?> diff --git a/ext/gd/tests/xpm2jpg.phpt b/ext/gd/tests/xpm2jpg.phpt index 3df491ce44..d412b074a7 100644 --- a/ext/gd/tests/xpm2jpg.phpt +++ b/ext/gd/tests/xpm2jpg.phpt @@ -1,13 +1,11 @@ --TEST-- xpm --> jpeg conversion test --SKIPIF-- - jpeg conversion test echo "XPM to JPEG conversion: "; echo imagejpeg(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.jpeg") ? 'ok' : 'failed'; echo "\n"; - + @unlink($cwd . "/test_xpm.jpeg"); ?> --EXPECT-- diff --git a/ext/gd/tests/xpm2png.phpt b/ext/gd/tests/xpm2png.phpt index 520cc3da0a..a5eadffd81 100644 --- a/ext/gd/tests/xpm2png.phpt +++ b/ext/gd/tests/xpm2png.phpt @@ -1,13 +1,11 @@ --TEST-- xpm --> png conversion test --SKIPIF-- - png conversion test echo "XPM to PNG conversion: "; echo imagepng(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.png") ? 'ok' : 'failed'; echo "\n"; - + @unlink($cwd . "/test_xpm.png"); ?> --EXPECT--