com php-src: Fixed test with freetype >= 2.4.1 2: ext/gd/tests/bug48801_1.phpt ext/gd/ tests/bug48801_2.phpt
| From: | Matteo Beccati | Date: | Wed, 03 Sep 2014 07:43:29 +0000 |
| Subject: | com php-src: Fixed test with freetype >= 2.4.1 2: ext/gd/tests/bug48801_1.phpt ext/gd/ tests/bug48801_2.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81393@lists.php.net to get a copy of this message | ||
Commit: 592df890276604c790d02be26b1b3c3710b3b888
Author: Matteo Beccati <mbeccati@php.net> Wed, 3 Sep 2014 09:43:29 +0200
Parents: 5e95b61639911f84f0cb16fb0a968f8c246d8a20
Branches: PHP-5.4 PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=592df890276604c790d02be26b1b3c3710b3b888
Log:
Fixed test with freetype >= 2.4.12
Changed paths:
M ext/gd/tests/bug48801_1.phpt
A ext/gd/tests/bug48801_2.phpt
Diff:
diff --git a/ext/gd/tests/bug48801_1.phpt b/ext/gd/tests/bug48801_1.phpt
index 11af80c..ef2aa1d 100644
--- a/ext/gd/tests/bug48801_1.phpt
+++ b/ext/gd/tests/bug48801_1.phpt
@@ -1,12 +1,13 @@
--TEST--
-Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10
+Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10 and < 2.4.12
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
include dirname(__FILE__) . '/func.inc';
- if(version_compare(get_freetype_version(), '2.4.10') == -1) die('skip for freetype
>= 2.4.10');
+ if(version_compare(get_freetype_version(), '2.4.10') < 0) die('skip for freetype
>= 2.4.10');
+ if(version_compare(get_freetype_version(), '2.4.12') >= 0) die('skip for
freetype < 2.4.12');
?>
--FILE--
<?php
diff --git a/ext/gd/tests/bug48801_2.phpt b/ext/gd/tests/bug48801_2.phpt
new file mode 100644
index 0000000..b2a719f
--- /dev/null
+++ b/ext/gd/tests/bug48801_2.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.12
+--SKIPIF--
+<?php
+ if(!extension_loaded('gd')){ die('skip gd extension not available'); }
+ if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
+
+ include dirname(__FILE__) . '/func.inc';
+ if(version_compare(get_freetype_version(), '2.4.12') < 0) die('skip for freetype
>= 2.4.12');
+?>
+--FILE--
+<?php
+$cwd = dirname(__FILE__);
+$font = "$cwd/Tuffy.ttf";
+$bbox = imageftbbox(50, 0, $font, "image");
+echo '(' . $bbox[0] . ', ' . $bbox[1] . ")\n";
+echo '(' . $bbox[2] .. ', ' . $bbox[3] . ")\n";
+echo '(' . $bbox[4] . ', ' . $bbox[5] . ")\n";
+echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
+?>
+--EXPECTF--
+(-1, 15)
+(155, 15)
+(155, -48)
+(-1, -48)