com php-src: Make test more resilient: ext/sockets/tests/socket _export_stream-3.phpt
| From: | Christoph Michael Becker | Date: | Thu, 21 Nov 2019 12:40:36 +0000 |
| Subject: | com php-src: Make test more resilient: ext/sockets/tests/socket _export_stream-3.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-109301@lists.php.net to get a copy of this message | ||
Commit: 424d34d1c0390d51e6b5eb0978644554453c6b16
Author: Christoph M. Becker <cmbecker69@gmx.de> Thu, 21 Nov 2019 13:40:36 +0100
Parents: b40799efcd79205c102909296f61fc30876dd658
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=424d34d1c0390d51e6b5eb0978644554453c6b16
Log:
Make test more resilient
socket_bind() may raise E_WARNING on failure, which would cause the
test to be marked as borked. Since we're checking the return value
anyway, we can silence warnings.
Changed paths:
M ext/sockets/tests/socket_export_stream-3.phpt
Diff:
diff --git a/ext/sockets/tests/socket_export_stream-3.phpt
b/ext/sockets/tests/socket_export_stream-3.phpt
index 69b0ebe47d2..b59c7700da7 100644
--- a/ext/sockets/tests/socket_export_stream-3.phpt
+++ b/ext/sockets/tests/socket_export_stream-3.phpt
@@ -6,7 +6,7 @@ if (!extension_loaded('sockets')) {
die('SKIP sockets extension not available.');
}
$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)
die("SKIP IPv4/port 58393 not available");
$so = @socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array(