1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/gd/tests/gh13082.phpt
Christoph M. Becker 02a60be24d Fix skip condition of gh13082.phpt
The test failure is not particularly related to Travis, but rather is
caused by the GD font file to only be suitable for platforms where
`int` stores 32bit values in little endian byte order.  This platform
dependence is documented in the source code[1].  Thus we fix the skip
condition and skip reason accordingly.

An alternative would be to dynamically create the font file just before
running the test, but that appears to be overkill.

[1] <d59691c02f/ext/gd/gd.c (L545-L556)>

Closes GH-14922.
2024-07-14 13:39:49 +02:00

19 lines
513 B
PHP

--TEST--
GH-13082 - imagefontwidth/height unexpectedly throwing an exception on a valid GdFont object.
--EXTENSIONS--
gd
--SKIPIF--
<?php if (pack('i', 0x01020304) !== "\x04\x03\x02\x01") die('skip unsupported platform'); ?>
--FILE--
<?php
$font = imageloadfont(__DIR__ . "/gh13082.gdf");
if ($font === false) die("imageloadfont failed");
if (!($font instanceof GdFont)) die("invalid gd font");
var_dump(imagefontwidth($font));
var_dump(imagefontheight($font));
?>
--EXPECT--
int(12)
int(20)