]> granicus.if.org Git - php/commitdiff
Fix test on Windows.
authorGustavo Lopes <glopes@nebm.ist.utl.pt>
Sun, 3 Feb 2013 01:00:48 +0000 (02:00 +0100)
committerGustavo Lopes <glopes@nebm.ist.utl.pt>
Sun, 3 Feb 2013 01:03:00 +0000 (02:03 +0100)
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.

ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt

index 00d69a855fb08a7b06a3f2223c174eacc40d63b1..5aeaa0824fa10eacd9ba3f8026e358e0088ec6db 100644 (file)
@@ -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