diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2015-07-20 03:05:22 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2015-07-20 03:05:22 +0200 |
commit | 2ec86112932e57b3f28a6448b5175a4089810cea (patch) | |
tree | 86f48f24b0d9ab359fad2a5d378995788c060ba6 /ext | |
parent | 72b73e24a00b9872214fbcc256ee38431d9c9d47 (diff) | |
download | php-git-2ec86112932e57b3f28a6448b5175a4089810cea.tar.gz |
revised bug53156.phpt
Diffstat (limited to 'ext')
-rw-r--r-- | ext/gd/tests/bug53156.phpt | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/ext/gd/tests/bug53156.phpt b/ext/gd/tests/bug53156.phpt index a269369670..24db8024fe 100644 --- a/ext/gd/tests/bug53156.phpt +++ b/ext/gd/tests/bug53156.phpt @@ -20,33 +20,31 @@ function draw_and_check_rectangle($x1, $y1, $x2, $y2) echo 'Rectangle: ';
imagerectangle($img, $x1, $y1, $x2, $y2, $black);
- draw_and_check_pixel(($x1 + $x2) / 2, $y1);
- draw_and_check_pixel($x1, ($y1 + $y2) / 2);
- draw_and_check_pixel(($x1 + $x2) / 2, $y2);
- draw_and_check_pixel($x2, ($y1 + $y2) / 2);
+ $x = ($x1 + $x2) / 2;
+ $y = ($y1 + $y2) / 2;
+ draw_and_check_pixel($x, $y1);
+ draw_and_check_pixel($x1, $y);
+ draw_and_check_pixel($x, $y2);
+ draw_and_check_pixel($x2, $y);
echo PHP_EOL;
}
$img = imagecreate(110, 210);
$bgnd = imagecolorallocate($img, 255, 255, 255);
-$black = imagecolorallocate($img, 0, 0, 0);
-$red = imagecolorallocate($img, 255, 0, 0);
+$black = imagecolorallocate($img, 0, 0, 0);
+$red = imagecolorallocate($img, 255, 0, 0);
-draw_and_check_rectangle(10, 10, 50, 50);
-draw_and_check_rectangle(50, 60, 10, 100);
-draw_and_check_rectangle(50, 150, 10, 110);
-draw_and_check_rectangle(10, 200, 50, 160);
+draw_and_check_rectangle( 10, 10, 50, 50);
+draw_and_check_rectangle( 50, 60, 10, 100);
+draw_and_check_rectangle( 50, 150, 10, 110);
+draw_and_check_rectangle( 10, 200, 50, 160);
imagesetthickness($img, 4);
-draw_and_check_rectangle(60, 10, 100, 50);
-draw_and_check_rectangle(100, 60, 60, 100);
-draw_and_check_rectangle(100, 150, 60, 110);
-draw_and_check_rectangle(60, 200, 100, 160);
+draw_and_check_rectangle( 60, 10, 100, 50);
+draw_and_check_rectangle(100, 60, 60, 100);
+draw_and_check_rectangle(100, 150, 60, 110);
+draw_and_check_rectangle( 60, 200, 100, 160);
-imagepng($img, __DIR__ . '/bug53156.png');
-?>
---CLEAN--
-<?php
-@unlink(__DIR__ . '/bug53156.png');
+//imagepng($img, __DIR__ . '/bug53156.png'); // debug
?>
--EXPECT--
Rectangle: ++++
|