Fix borked SKIPIFs

This commit is contained in:
Fabien Villepinte 2019-09-28 21:29:54 +02:00 committed by Nikita Popov
parent 1f0ffece91
commit 0aa3acc6c4
42 changed files with 74 additions and 57 deletions

View file

@ -4,7 +4,7 @@ Bug #54995 (Missing CURLINFO_RESPONSE_CODE support)
<?php <?php
include 'skipif.inc'; include 'skipif.inc';
if ($curl_version['version_number'] > 0x070a08) { if (curl_version()['version_number'] > 0x070a08) {
exit("skip: tests works a versions of curl >= 7.10.8"); exit("skip: tests works a versions of curl >= 7.10.8");
} }
?> ?>

View file

@ -1,7 +1,7 @@
--TEST-- --TEST--
Handling of large year values Handling of large year values
--SKIPIF-- --SKIPIF--
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK"; ?> <?php if (PHP_INT_SIZE != 8) die("skip 64-bit only"); ?>
--FILE-- --FILE--
<?php <?php
date_default_timezone_set("America/Toronto"); date_default_timezone_set("America/Toronto");

View file

@ -3,9 +3,11 @@ Bug #26317 (military timezone offset signedness)
--INI-- --INI--
date.timezone=GMT0 date.timezone=GMT0
--SKIPIF-- --SKIPIF--
<?php
if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') {
die("skip unable to change TZ environment variable\n"); die("skip unable to change TZ environment variable\n");
} }
?>
--FILE-- --FILE--
<?php <?php
echo date("Y-m-d H:i:s\n", strtotime("2003-11-19 16:20:42 Z")); echo date("Y-m-d H:i:s\n", strtotime("2003-11-19 16:20:42 Z"));

View file

@ -3,9 +3,11 @@ Bug #26320 (strtotime handling of XML Schema/ISO 8601 format)
--INI-- --INI--
date.timezone=GMT0 date.timezone=GMT0
--SKIPIF-- --SKIPIF--
<?php
if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') {
die("skip unable to change TZ environment variable\n"); die("skip unable to change TZ environment variable\n");
} }
?>
--FILE-- --FILE--
<?php <?php
echo date("Y-m-d H:i:s\n", strtotime("2003-11-19T12:30:42")); echo date("Y-m-d H:i:s\n", strtotime("2003-11-19T12:30:42"));

View file

@ -1,7 +1,7 @@
--TEST-- --TEST--
Bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as 1999-11-30) (64 bit) Bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as 1999-11-30) (64 bit)
--SKIPIF-- --SKIPIF--
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK"; ?> <?php if (PHP_INT_SIZE != 8) die("skip 64-bit only"); ?>
--FILE-- --FILE--
<?php <?php
date_default_timezone_set("UTC"); date_default_timezone_set("UTC");

View file

@ -1,7 +1,7 @@
--TEST-- --TEST--
Bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as 1999-11-30) (32 bit) Bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as 1999-11-30) (32 bit)
--SKIPIF-- --SKIPIF--
<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK"; ?> <?php if (PHP_INT_SIZE == 8) die("skip 32-bit only"); ?>
--FILE-- --FILE--
<?php <?php
date_default_timezone_set("UTC"); date_default_timezone_set("UTC");

View file

@ -1,7 +1,7 @@
--TEST-- --TEST--
Test for bug #75851: Year component overflow with date formats "c", "o", "r" and "y" Test for bug #75851: Year component overflow with date formats "c", "o", "r" and "y"
--SKIPIF-- --SKIPIF--
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK"; ?> <?php if (PHP_INT_SIZE != 8) die("skip 64-bit only"); ?>
--INI-- --INI--
date.timezone = UTC date.timezone = UTC
--FILE-- --FILE--

View file

@ -1,7 +1,7 @@
--TEST-- --TEST--
mktime() [3] (64-bit) mktime() [3] (64-bit)
--SKIPIF-- --SKIPIF--
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK" ?> <?php if (PHP_INT_SIZE != 8) die("skip 64-bit only"); ?>
--INI-- --INI--
error_reporting=2047 error_reporting=2047
--FILE-- --FILE--

View file

@ -1,7 +1,7 @@
--TEST-- --TEST--
mktime() [3] (32-bit) mktime() [3] (32-bit)
--SKIPIF-- --SKIPIF--
<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK" ?> <?php if (PHP_INT_SIZE == 8) die("skip 32-bit only"); ?>
--INI-- --INI--
error_reporting=2047 error_reporting=2047
--FILE-- --FILE--

View file

@ -1,7 +1,7 @@
--TEST-- --TEST--
strtotime() and mysql timestamps (64 bit) strtotime() and mysql timestamps (64 bit)
--SKIPIF-- --SKIPIF--
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK"; ?> <?php if (PHP_INT_SIZE != 8) die("skip 64-bit only"); ?>
--FILE-- --FILE--
<?php <?php
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');

View file

@ -1,7 +1,7 @@
--TEST-- --TEST--
strtotime() and mysql timestamps (32 bit) strtotime() and mysql timestamps (32 bit)
--SKIPIF-- --SKIPIF--
<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK"; ?> <?php if (PHP_INT_SIZE == 8) die("skip 32-bit only"); ?>
--FILE-- --FILE--
<?php <?php
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');

View file

@ -1,7 +1,7 @@
--TEST-- --TEST--
strtotime() function (64 bit) strtotime() function (64 bit)
--SKIPIF-- --SKIPIF--
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK"; ?> <?php if (PHP_INT_SIZE != 8) die("skip 64-bit only"); ?>
--FILE-- --FILE--
<?php <?php
date_default_timezone_set('Europe/Lisbon'); date_default_timezone_set('Europe/Lisbon');

View file

@ -1,7 +1,7 @@
--TEST-- --TEST--
strtotime() function (32 bit) strtotime() function (32 bit)
--SKIPIF-- --SKIPIF--
<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK"; ?> <?php if (PHP_INT_SIZE == 8) die("skip 32-bit only"); ?>
--FILE-- --FILE--
<?php <?php
date_default_timezone_set('Europe/Lisbon'); date_default_timezone_set('Europe/Lisbon');

View file

@ -5,7 +5,7 @@ memory_limit=-1
--SKIPIF-- --SKIPIF--
<?php <?php
if (!extension_loaded('gd')) die('skip gd extension not available'); if (!extension_loaded('gd')) die('skip gd extension not available');
if (!GD_BUNGLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released'); if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
?> ?>
--FILE-- --FILE--

View file

@ -1,16 +1,15 @@
--TEST-- --TEST--
imageploygon() imagepolygon()
--SKIPIF-- --SKIPIF--
<?php <?php
if (!function_exists('imagepolygon')) die('skip imagepolygon() not available'); if (!function_exists('imagepolygon')) die('skip imagepolygon() not available');
require_once('skipif_imagetype.inc');
?> ?>
--FILE-- --FILE--
<?php <?php
/* Prototype : bool imagepolygon ( resource $image , array $points , int $num_points , int $color ) /* Prototype : bool imagepolygon ( resource $image , array $points , int $num_points , int $color )
* Description: Draws a polygon. * Description: Draws a polygon.
* Source code: ext/standard/image.c * Source code: ext/gd/gd.c
* Alias to functions: * Alias to functions:
*/ */

View file

@ -2,7 +2,7 @@
Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer
--SKIPIF-- --SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK"; ?> <?php if (PHP_INT_SIZE == 8) die("skip 32-bit only"); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -2,7 +2,7 @@
Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer
--SKIPIF-- --SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK"; ?> <?php if (PHP_INT_SIZE != 8) die("skip 64-bit only"); ?>
--FILE-- --FILE--
<?php <?php

View file

@ -8,7 +8,7 @@ Patrick Allaert <patrickallaert@php.net>
<?php if (!function_exists("ldap_sasl_bind")) die("skip LDAP extension not compiled with SASL support"); ?> <?php if (!function_exists("ldap_sasl_bind")) die("skip LDAP extension not compiled with SASL support"); ?>
<?php <?php
require "connect.inc"; require "connect.inc";
$link = fsockopen($host, $port); $link = @fsockopen($host, $port);
if (!$link) { if (!$link) {
die("skip no server listening"); die("skip no server listening");
} }

View file

@ -7,7 +7,7 @@ mysqli_stmt_bind_result (SHOW)
require_once('skipifconnectfailure.inc'); require_once('skipifconnectfailure.inc');
require_once("connect.inc"); require_once("connect.inc");
$link = my_mysqli_connect($host, $user, $passwd); $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'"); $stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
mysqli_stmt_execute($stmt); mysqli_stmt_execute($stmt);

View file

@ -6,7 +6,7 @@ require_once('skipif.inc');
require_once('skipifemb.inc'); require_once('skipifemb.inc');
require_once('connect.inc'); require_once('connect.inc');
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
die(sprintf("SKIP Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", die(sprintf("SKIP Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket)); $host, $user, $db, $port, $socket));
} }

View file

@ -6,7 +6,7 @@ require_once('skipif.inc');
require_once('skipifemb.inc'); require_once('skipifemb.inc');
require_once('connect.inc'); require_once('connect.inc');
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
die(sprintf("SKIP Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", die(sprintf("SKIP Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket)); $host, $user, $db, $port, $socket));
} }

View file

@ -10,7 +10,7 @@ PDOTest::skip();
$db = PDOTest::factory(); $db = PDOTest::factory();
if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'pgsql') die('skip pgsql has its own test for this feature'); if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'pgsql') die('skip pgsql has its own test for this feature');
if (!$db->getAttribute(PDO::ATTR_EMULATE_PREPARES) && !$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true)) die('skip driver cannot emulate prepared statements'); if (!@$db->getAttribute(PDO::ATTR_EMULATE_PREPARES) && !@$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true)) die('skip driver cannot emulate prepared statements');
?> ?>
--FILE-- --FILE--
<?php <?php

View file

@ -13,10 +13,10 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n")); die(sprintf("skip Cannot determine MySQL Server version\n"));
$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2]; $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 50000) if ($version < 50000)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
$matches[0], $matches[1], $matches[2], $version)); $matches[1], $matches[2], $matches[3], $version));
?> ?>
--FILE-- --FILE--
<?php <?php

View file

@ -12,11 +12,11 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n")); die(sprintf("skip Cannot determine MySQL Server version\n"));
$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2]; $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
die("skip $version"); die("skip $version");
if ($version < 40100) if ($version < 40100)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
$matches[0], $matches[1], $matches[2], $version)); $matches[1], $matches[2], $matches[3], $version));
?> ?>
--FILE-- --FILE--
<?php <?php

View file

@ -12,10 +12,10 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n")); die(sprintf("skip Cannot determine MySQL Server version\n"));
$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2]; $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 50000) if ($version < 50000)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
$matches[0], $matches[1], $matches[2], $version)); $matches[1], $matches[2], $matches[3], $version));
?> ?>
--FILE-- --FILE--
<?php <?php

View file

@ -15,10 +15,10 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n")); die(sprintf("skip Cannot determine MySQL Server version\n"));
$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2]; $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 41000) if ($version < 41000)
die(sprintf("skip Need MySQL Server 4.1.0+, found %d.%02d.%02d (%d)\n", die(sprintf("skip Need MySQL Server 4.1.0+, found %d.%02d.%02d (%d)\n",
$matches[0], $matches[1], $matches[2], $version)); $matches[1], $matches[2], $matches[3], $version));
--FILE-- --FILE--
<?php <?php
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');

View file

@ -15,10 +15,10 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n")); die(sprintf("skip Cannot determine MySQL Server version\n"));
$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2]; $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 41000) if ($version < 41000)
die(sprintf("skip Will work different with MySQL Server < 4.1.0, found %d.%02d.%02d (%d)\n", die(sprintf("skip Will work different with MySQL Server < 4.1.0, found %d.%02d.%02d (%d)\n",
$matches[0], $matches[1], $matches[2], $version)); $matches[1], $matches[2], $matches[3], $version));
?> ?>
--FILE-- --FILE--
<?php <?php

View file

@ -13,10 +13,10 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n")); die(sprintf("skip Cannot determine MySQL Server version\n"));
$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2]; $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 40106) if ($version < 40106)
die(sprintf("skip Need MySQL Server 4.1.6+, found %d.%02d.%02d (%d)\n", die(sprintf("skip Need MySQL Server 4.1.6+, found %d.%02d.%02d (%d)\n",
$matches[0], $matches[1], $matches[2], $version)); $matches[1], $matches[2], $matches[3], $version));
?> ?>
--FILE-- --FILE--
<?php <?php

View file

@ -13,10 +13,10 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n")); die(sprintf("skip Cannot determine MySQL Server version\n"));
$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2]; $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 50000) if ($version < 50000)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
$matches[0], $matches[1], $matches[2], $version)); $matches[1], $matches[2], $matches[3], $version));
?> ?>
--FILE-- --FILE--
<?php <?php

View file

@ -11,10 +11,10 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n")); die(sprintf("skip Cannot determine MySQL Server version\n"));
$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2]; $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 50000) if ($version < 50000)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
$matches[0], $matches[1], $matches[2], $version)); $matches[1], $matches[2], $matches[3], $version));
if (!MySQLPDOTest::isPDOMySQLnd()) if (!MySQLPDOTest::isPDOMySQLnd())
die("skip This will not work with libmysql"); die("skip This will not work with libmysql");

View file

@ -13,10 +13,10 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n")); die(sprintf("skip Cannot determine MySQL Server version\n"));
$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2]; $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 50000) if ($version < 50000)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
$matches[0], $matches[1], $matches[2], $version)); $matches[1], $matches[2], $matches[3], $version));
if (!MySQLPDOTest::isPDOMySQLnd()) if (!MySQLPDOTest::isPDOMySQLnd())
die("skip This will not work with libmysql"); die("skip This will not work with libmysql");

View file

@ -12,10 +12,10 @@ $matches = array();
if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
die(sprintf("skip Cannot determine MySQL Server version\n")); die(sprintf("skip Cannot determine MySQL Server version\n"));
$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2]; $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3];
if ($version < 50000) if ($version < 50000)
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
$matches[0], $matches[1], $matches[2], $version)); $matches[1], $matches[2], $matches[3], $version));
?> ?>
--FILE-- --FILE--
<?php <?php

View file

@ -4,7 +4,10 @@ readline() function - without input
Jonathan Stevens <info at jonathanstevens dot be> Jonathan Stevens <info at jonathanstevens dot be>
User Group: PHP-WVL & PHPGent #PHPTestFest User Group: PHP-WVL & PHPGent #PHPTestFest
--SKIPIF-- --SKIPIF--
<?php if (!extension_loaded("readline") || !function_exists('readline') || die("skip"); ?> <?php
if (!extension_loaded("readline")) die("skip readline extension is not available");
if (!function_exists('readline')) die("skip readline() not available");
?>
--FILE-- --FILE--
<?php <?php
var_dump(readline()); var_dump(readline());

View file

@ -5,6 +5,12 @@ Multicast support: IPv4 send options with unusual values
if (!extension_loaded('sockets')) { if (!extension_loaded('sockets')) {
die('skip sockets extension not available.'); die('skip sockets extension not available.');
} }
$domain = AF_INET;
$level = IPPROTO_IP;
$s = socket_create($domain, SOCK_DGRAM, SOL_UDP);
if ($s === false) {
die("skip unable to create socket");
}
if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) { if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) {
die("skip interface 1 either doesn't exist or has no ipv4 address"); die("skip interface 1 either doesn't exist or has no ipv4 address");
} }

View file

@ -16,7 +16,7 @@ $br = socket_bind($s, '::', 3000);
/* On Linux, there is no route ff00::/8 by default on lo, which makes it /* On Linux, there is no route ff00::/8 by default on lo, which makes it
* troublesome to send multicast traffic from lo, which we must since * troublesome to send multicast traffic from lo, which we must since
* we're dealing with interface-local traffic... */ * we're dealing with interface-local traffic... */
$so = socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_GROUP, array( $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_GROUP, array(
"group" => 'ff01::114', "group" => 'ff01::114',
"interface" => 0, "interface" => 0,
)); ));
@ -31,11 +31,11 @@ if ($r === false) {
if (!defined("MCAST_JOIN_SOURCE_GROUP")) if (!defined("MCAST_JOIN_SOURCE_GROUP"))
die('skip source operations are unavailable'); die('skip source operations are unavailable');
$so = socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array( $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array(
"group" => 'ff01::114', "group" => 'ff01::114',
"interface" => 0, "interface" => 0,
)); ));
$so = socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array(
"group" => 'ff01::114', "group" => 'ff01::114',
"interface" => 0, "interface" => 0,
"source" => '2001::dead:beef', "source" => '2001::dead:beef',

View file

@ -13,7 +13,7 @@ $br = socket_bind($s, '::', 3000);
/* On Linux, there is no route ff00::/8 by default on lo, which makes it /* On Linux, there is no route ff00::/8 by default on lo, which makes it
* troublesome to send multicast traffic from lo, which we must since * troublesome to send multicast traffic from lo, which we must since
* we're dealing with interface-local traffic... */ * we're dealing with interface-local traffic... */
$so = socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_GROUP, array( $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_GROUP, array(
"group" => 'ff01::114', "group" => 'ff01::114',
"interface" => 0, "interface" => 0,
)); ));
@ -24,12 +24,12 @@ $r = socket_sendto($s, $m = "testing packet", strlen($m), 0, 'ff01::114', 3000);
if ($r === false) { if ($r === false) {
die('skip unable to send multicast packet.'); die('skip unable to send multicast packet.');
} }
$so = socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array( $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array(
"group" => 'ff01::114', "group" => 'ff01::114',
"interface" => 0, "interface" => 0,
)); ));
if (defined("MCAST_JOIN_SOURCE_GROUP")) { if (defined("MCAST_JOIN_SOURCE_GROUP")) {
$so = socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array(
"group" => 'ff01::114', "group" => 'ff01::114',
"interface" => 0, "interface" => 0,
"source" => '2001::dead:beef', "source" => '2001::dead:beef',

View file

@ -9,7 +9,7 @@ $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$br = socket_bind($s, '0.0.0.0', 58393); $br = socket_bind($s, '0.0.0.0', 58393);
if ($br === false) if ($br === false)
die("SKIP IPv4/port 58393 not available"); die("SKIP IPv4/port 58393 not available");
$so = socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array( $so = @socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array(
"group" => '224.0.0.23', "group" => '224.0.0.23',
"interface" => "lo", "interface" => "lo",
)); ));

View file

@ -9,7 +9,7 @@ $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$br = socket_bind($s, '0.0.0.0', 58379); $br = socket_bind($s, '0.0.0.0', 58379);
if ($br === false) if ($br === false)
die("SKIP IPv4/port 58379 not available"); die("SKIP IPv4/port 58379 not available");
$so = socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array( $so = @socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array(
"group" => '224.0.0.23', "group" => '224.0.0.23',
"interface" => "lo", "interface" => "lo",
)); ));

View file

@ -7,7 +7,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. Not valid for Windows'); die('skip.. Not valid for Windows');
} }
?> ?>
?>
--FILE-- --FILE--
<?php <?php
/* Prototype: array lstat ( string $filename ); /* Prototype: array lstat ( string $filename );

View file

@ -3,7 +3,7 @@ sapi_windows_set_ctrl_handler()
--SKIPIF-- --SKIPIF--
<?php <?php
include "skipinf.inc"; include "skipif.inc";
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
die("skip this test is for Windows platforms only"); die("skip this test is for Windows platforms only");

View file

@ -8,10 +8,16 @@ if (PHP_INT_SIZE < 8) {
die("skip need PHP_INT_SIZE>=8"); die("skip need PHP_INT_SIZE>=8");
} }
if (!file_exists('/proc/meminfo')) {
die('skip Cannot check free RAM from /proc/meminfo on this platform');
}
$free_ram = 0;
if ($f = fopen("/proc/meminfo","r")) { if ($f = fopen("/proc/meminfo","r")) {
while (!feof($f)) { while (!feof($f)) {
if (!strncmp($line = fgets($f), "MemFree", 7)) { if (preg_match('/MemFree[^\d]*(\d+)/i', fgets($f), $m)) {
if (substr($line,8)/1024/1024 > 3) { $free_ram = max($free_ram, $m[1]/1024/1024);
if ($free_ram > 3) {
$enough_free_ram = true; $enough_free_ram = true;
} }
} }
@ -19,7 +25,7 @@ if ($f = fopen("/proc/meminfo","r")) {
} }
if (empty($enough_free_ram)) { if (empty($enough_free_ram)) {
die("skip need +3G free RAM"); die(sprintf("skip need +3G free RAM, but only %01.2f available", $free_ram));
} }
if (getenv('TRAVIS')) { if (getenv('TRAVIS')) {

View file

@ -2,7 +2,7 @@
Bug #20539 (PHP CLI Segmentation Fault) Bug #20539 (PHP CLI Segmentation Fault)
--SKIPIF-- --SKIPIF--
<?php if (!extension_loaded("session")) die("skip session extension not available"); ?> <?php if (!extension_loaded("session")) die("skip session extension not available"); ?>
<?php unlink(__DIR__. '/sess_' .session_id()); ?> <?php if (file_exists(__DIR__. '/sess_' .session_id())) unlink(__DIR__. '/sess_' .session_id()); ?>
--INI-- --INI--
session.auto_start=1 session.auto_start=1
session.save_handler=files session.save_handler=files