Skip to content

Commit 3a6984e

Browse files
committed
ext/gd: Remove bool type coercions in tests and ZPP tests
1 parent eb39385 commit 3a6984e

File tree

6 files changed

+13
-31
lines changed

6 files changed

+13
-31
lines changed

ext/gd/tests/bug38179.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ $src = imagecreate(5,5);
88
$c0 = imagecolorallocate($src, 255,255,255);
99
$c1 = imagecolorallocatealpha($src, 255,0,0,70);
1010

11-
imagealphablending($src, 0);
11+
imagealphablending($src, false);
1212
imagefill($src, 0,0, $c1);
1313

1414
$dst_tc = imagecreatetruecolor(5,5);
15-
imagealphablending($dst_tc, 0);
15+
imagealphablending($dst_tc, false);
1616

1717
imagecopy($dst_tc, $src, 0,0, 0,0, imagesx($src), imagesy($src));
1818

ext/gd/tests/bug39273.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ gd
77
$small = imagecreatetruecolor(10, 10);
88
$c1 = imagecolorallocatealpha($small, 255,0,0,50);
99
imagecolortransparent($small, 0);
10-
imagealphablending($small, 0);
10+
imagealphablending($small, false);
1111
imagefilledrectangle($small, 0,0, 6,6, $c1);
1212

1313
$width = 300;
@@ -20,7 +20,7 @@ $img = imagecreatetruecolor($width, $height);
2020
imagecolortransparent($img, 0);
2121
imagealphablending($img, false);
2222
imagecopyresized($img, $small, 0,0, 0,0, $width, $height, $srcw, $srch);
23-
imagesavealpha($img, 1);
23+
imagesavealpha($img, true);
2424

2525
$c = imagecolorat($img, 0,0);
2626
printf("%X", $c);

ext/gd/tests/bug39366.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ gd
66
<?php
77

88
$im = imagecreatetruecolor(10,10);
9-
imagealphablending($im, 0);
9+
imagealphablending($im, false);
1010
imagefilledrectangle($im, 0,0, 8,8, 0x32FF0000);
1111
$rotate = imagerotate($im, 180, 0);
12-
imagecolortransparent($rotate,0);
12+
imagecolortransparent($rotate, 0);
1313
imagesavealpha($rotate, true);
1414
$c = imagecolorat($rotate,5,5);
1515
printf("%X\n", $c);

ext/gd/tests/imageantialias_error2.phpt

Lines changed: 0 additions & 21 deletions
This file was deleted.

ext/gd/tests/imageloadfont_invalid.phpt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ fclose($fp);
1212

1313
$image = imagecreatetruecolor(50, 20);
1414
$font = imageloadfont($filename);
15-
$black = imagecolorallocate($image, 0, 0, 0);
16-
imagestring($image, $font, 0, 0, "Hello", $black);
17-
unlink($filename);
15+
?>
16+
--CLEAN--
17+
<?php
18+
$filename = __DIR__ . '/imageloadfont_invalid.gdf';
19+
@unlink($filename);
1820
?>
1921
--EXPECTF--
2022
Warning: imageloadfont(): Product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully

ext/gd/tests/test_image_equals_file_palette.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ The images differ in 25 pixels.
4343
The images are equal.
4444
--CLEAN--
4545
<?php
46-
unlink(__DIR__ . DIRECTORY_SEPARATOR . 'test_image_equals_file_palette.png');
46+
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'test_image_equals_file_palette.png';
47+
@unlink($filename);
4748
?>

0 commit comments

Comments
 (0)