com php-src: Fix test on Windows.: ext/sockets/tests/socket_s entto_recvfrom_ipv4_udp.phpt

From: Date: Sun, 03 Feb 2013 01:03:00 +0000
Subject: com php-src: Fix test on Windows.: ext/sockets/tests/socket_s entto_recvfrom_ipv4_udp.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-71151@lists.php.net to get a copy of this message
Commit: 8771c265a43dac2e44aa4ae7af66a6534b0c70ae Author: Gustavo Lopes <glopes@nebm.ist.utl.pt> Sun, 3 Feb 2013 02:00:48 +0100 Parents: a000920dfb099fac3b58ea344d33f4b6c3ee51a1 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8771c265a43dac2e44aa4ae7af66a6534b0c70ae Log: 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. Changed paths: M ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt Diff: diff --git a/ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt b/ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt index 00d69a8..5aeaa08 100644 --- a/ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt +++ b/ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt @@ -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

« previous php.cvs (#71151) next »