mirror of
https://github.com/php/php-src.git
synced 2024-12-01 05:43:38 +08:00
Fix test on Windows.
Windows complains of invalid parameters because the socket is not bound. The test expected the error to be EAGAIN/EWOULDBLOCK. Moved the call down, after the socket is bound.
This commit is contained in:
parent
a000920dfb
commit
8771c265a4
@ -14,12 +14,14 @@ if (!extension_loaded('sockets')) {
|
||||
if (!socket_set_nonblock($socket)) {
|
||||
die('Unable to set nonblocking mode for socket');
|
||||
}
|
||||
var_dump(socket_recvfrom($socket, $buf, 12, 0, $from, $port)); //false (EAGAIN - no warning)
|
||||
|
||||
$address = '127.0.0.1';
|
||||
socket_sendto($socket, '', 1, 0, $address); // cause warning
|
||||
if (!socket_bind($socket, $address, 1223)) {
|
||||
die("Unable to bind to $address:1223");
|
||||
}
|
||||
|
||||
var_dump(socket_recvfrom($socket, $buf, 12, 0, $from, $port)); //false (EAGAIN - no warning)
|
||||
|
||||
$msg = "Ping!";
|
||||
$len = strlen($msg);
|
||||
@ -44,9 +46,9 @@ if (!extension_loaded('sockets')) {
|
||||
|
||||
socket_close($socket);
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
|
||||
Warning: Wrong parameter count for socket_sendto() in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: socket_recvfrom() expects at least 5 parameters, 4 given in %s on line %d
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user