From 0aa3acc6c420ef19a33ee80e65c4fb2f2ee128d0 Mon Sep 17 00:00:00 2001 From: Fabien Villepinte Date: Sat, 28 Sep 2019 21:29:54 +0200 Subject: [PATCH] Fix borked SKIPIFs --- ext/curl/tests/bug54995.phpt | 2 +- ext/date/tests/big_year.phpt | 2 +- ext/date/tests/bug26317.phpt | 2 ++ ext/date/tests/bug26320.phpt | 2 ++ ext/date/tests/bug41523-64bit.phpt | 2 +- ext/date/tests/bug41523.phpt | 2 +- ext/date/tests/bug75851.phpt | 2 +- ext/date/tests/mktime-3-64bit.phpt | 2 +- ext/date/tests/mktime-3.phpt | 2 +- ext/date/tests/strtotime-mysql-64bit.phpt | 2 +- ext/date/tests/strtotime-mysql.phpt | 2 +- ext/date/tests/strtotime3-64bit.phpt | 2 +- ext/date/tests/strtotime3.phpt | 2 +- ext/gd/tests/bug77272.phpt | 2 +- ext/gd/tests/imagepolygon_basic.phpt | 5 ++--- ext/intl/tests/bug59597_32.phpt | 2 +- ext/intl/tests/bug59597_64.phpt | 2 +- ext/ldap/tests/ldap_sasl_bind_basic.phpt | 2 +- ext/mysqli/tests/045.phpt | 2 +- ext/mysqli/tests/mysqli_auth_pam.phpt | 2 +- ext/mysqli/tests/mysqli_expire_password.phpt | 2 +- ext/pdo/tests/debug_emulated_prepares.phpt | 2 +- ext/pdo_mysql/tests/bug_39858.phpt | 4 ++-- ext/pdo_mysql/tests/bug_41125.phpt | 4 ++-- ext/pdo_mysql/tests/bug_41997.phpt | 4 ++-- ext/pdo_mysql/tests/bug_42499.phpt | 4 ++-- ext/pdo_mysql/tests/bug_44707.phpt | 4 ++-- ext/pdo_mysql/tests/bug_61411.phpt | 4 ++-- ext/pdo_mysql/tests/bug_pecl_7976.phpt | 4 ++-- .../tests/pdo_mysql_multi_stmt_nextrowset.phpt | 4 ++-- ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt | 4 ++-- .../tests/pdo_mysql_stmt_variable_columncount.phpt | 4 ++-- ext/readline/tests/readline_without_input.phpt | 5 ++++- ext/sockets/tests/mcast_ipv4_send_error.phpt | 6 ++++++ ext/sockets/tests/mcast_ipv6_recv.phpt | 6 +++--- ext/sockets/tests/mcast_ipv6_recv_limited.phpt | 6 +++--- ext/sockets/tests/socket_export_stream-3.phpt | 2 +- ext/sockets/tests/socket_import_stream-3.phpt | 2 +- ext/standard/tests/file/lstat_stat_variation5.phpt | 1 - sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt | 2 +- sapi/cli/tests/upload_2G.phpt | 12 +++++++++--- tests/basic/bug20539.phpt | 2 +- 42 files changed, 74 insertions(+), 57 deletions(-) diff --git a/ext/curl/tests/bug54995.phpt b/ext/curl/tests/bug54995.phpt index ea2b739762..0250749731 100644 --- a/ext/curl/tests/bug54995.phpt +++ b/ext/curl/tests/bug54995.phpt @@ -4,7 +4,7 @@ Bug #54995 (Missing CURLINFO_RESPONSE_CODE support) 0x070a08) { +if (curl_version()['version_number'] > 0x070a08) { exit("skip: tests works a versions of curl >= 7.10.8"); } ?> diff --git a/ext/date/tests/big_year.phpt b/ext/date/tests/big_year.phpt index 6f86e524b5..d1e70b6b0a 100644 --- a/ext/date/tests/big_year.phpt +++ b/ext/date/tests/big_year.phpt @@ -1,7 +1,7 @@ --TEST-- Handling of large year values --SKIPIF-- - + --FILE-- --FILE-- --FILE-- + --FILE-- + --FILE-- + --INI-- date.timezone = UTC --FILE-- diff --git a/ext/date/tests/mktime-3-64bit.phpt b/ext/date/tests/mktime-3-64bit.phpt index cbb441f13c..f415cbf2d6 100644 --- a/ext/date/tests/mktime-3-64bit.phpt +++ b/ext/date/tests/mktime-3-64bit.phpt @@ -1,7 +1,7 @@ --TEST-- mktime() [3] (64-bit) --SKIPIF-- - + --INI-- error_reporting=2047 --FILE-- diff --git a/ext/date/tests/mktime-3.phpt b/ext/date/tests/mktime-3.phpt index ce1a203a20..cc16083965 100644 --- a/ext/date/tests/mktime-3.phpt +++ b/ext/date/tests/mktime-3.phpt @@ -1,7 +1,7 @@ --TEST-- mktime() [3] (32-bit) --SKIPIF-- - + --INI-- error_reporting=2047 --FILE-- diff --git a/ext/date/tests/strtotime-mysql-64bit.phpt b/ext/date/tests/strtotime-mysql-64bit.phpt index c511d626e9..356e485949 100644 --- a/ext/date/tests/strtotime-mysql-64bit.phpt +++ b/ext/date/tests/strtotime-mysql-64bit.phpt @@ -1,7 +1,7 @@ --TEST-- strtotime() and mysql timestamps (64 bit) --SKIPIF-- - + --FILE-- + --FILE-- + --FILE-- + --FILE-- --FILE-- diff --git a/ext/gd/tests/imagepolygon_basic.phpt b/ext/gd/tests/imagepolygon_basic.phpt index 21186e9ecc..5dfecfbf19 100644 --- a/ext/gd/tests/imagepolygon_basic.phpt +++ b/ext/gd/tests/imagepolygon_basic.phpt @@ -1,16 +1,15 @@ --TEST-- -imageploygon() +imagepolygon() --SKIPIF-- --FILE-- - + --FILE-- - + --FILE-- 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-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- User Group: PHP-WVL & PHPGent #PHPTestFest --SKIPIF-- - + --FILE-- 'ff01::114', "interface" => 0, )); @@ -31,11 +31,11 @@ if ($r === false) { if (!defined("MCAST_JOIN_SOURCE_GROUP")) 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', "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', "interface" => 0, "source" => '2001::dead:beef', diff --git a/ext/sockets/tests/mcast_ipv6_recv_limited.phpt b/ext/sockets/tests/mcast_ipv6_recv_limited.phpt index e989e9b58c..c739264062 100644 --- a/ext/sockets/tests/mcast_ipv6_recv_limited.phpt +++ b/ext/sockets/tests/mcast_ipv6_recv_limited.phpt @@ -13,7 +13,7 @@ $br = socket_bind($s, '::', 3000); /* 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 * 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', "interface" => 0, )); @@ -24,12 +24,12 @@ $r = socket_sendto($s, $m = "testing packet", strlen($m), 0, 'ff01::114', 3000); if ($r === false) { 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', "interface" => 0, )); 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', "interface" => 0, "source" => '2001::dead:beef', diff --git a/ext/sockets/tests/socket_export_stream-3.phpt b/ext/sockets/tests/socket_export_stream-3.phpt index 63134cb401..69b0ebe47d 100644 --- a/ext/sockets/tests/socket_export_stream-3.phpt +++ b/ext/sockets/tests/socket_export_stream-3.phpt @@ -9,7 +9,7 @@ $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); $br = socket_bind($s, '0.0.0.0', 58393); if ($br === false) 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', "interface" => "lo", )); diff --git a/ext/sockets/tests/socket_import_stream-3.phpt b/ext/sockets/tests/socket_import_stream-3.phpt index 8a8ac4f5e4..f83e8a487b 100644 --- a/ext/sockets/tests/socket_import_stream-3.phpt +++ b/ext/sockets/tests/socket_import_stream-3.phpt @@ -9,7 +9,7 @@ $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); $br = socket_bind($s, '0.0.0.0', 58379); if ($br === false) 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', "interface" => "lo", )); diff --git a/ext/standard/tests/file/lstat_stat_variation5.phpt b/ext/standard/tests/file/lstat_stat_variation5.phpt index 34401dc55d..b5c03c3f08 100644 --- a/ext/standard/tests/file/lstat_stat_variation5.phpt +++ b/ext/standard/tests/file/lstat_stat_variation5.phpt @@ -7,7 +7,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. Not valid for Windows'); } ?> -?> --FILE-- =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")) { while (!feof($f)) { - if (!strncmp($line = fgets($f), "MemFree", 7)) { - if (substr($line,8)/1024/1024 > 3) { + if (preg_match('/MemFree[^\d]*(\d+)/i', fgets($f), $m)) { + $free_ram = max($free_ram, $m[1]/1024/1024); + if ($free_ram > 3) { $enough_free_ram = true; } } @@ -19,7 +25,7 @@ if ($f = fopen("/proc/meminfo","r")) { } 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')) { diff --git a/tests/basic/bug20539.phpt b/tests/basic/bug20539.phpt index 6c2cfb2647..2b84d14189 100644 --- a/tests/basic/bug20539.phpt +++ b/tests/basic/bug20539.phpt @@ -2,7 +2,7 @@ Bug #20539 (PHP CLI Segmentation Fault) --SKIPIF-- - + --INI-- session.auto_start=1 session.save_handler=files -- 2.40.0