summaryrefslogtreecommitdiff
path: root/ext/sockets/tests
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2009-07-03 14:02:28 +0000
committerAntony Dovgal <tony2001@php.net>2009-07-03 14:02:28 +0000
commit572598261433b1243623b217ed69b758467ececc (patch)
tree3907e16b86b50aa68bc8e9c8ede353dd3c4cfbb4 /ext/sockets/tests
parentb90a412302855f5d9eb8247dd77f3f8bfc063c52 (diff)
downloadphp-git-572598261433b1243623b217ed69b758467ececc.tar.gz
stop polluting my /tmp dir
Diffstat (limited to 'ext/sockets/tests')
-rw-r--r--ext/sockets/tests/socket_sentto_recvfrom_unix.phpt6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt b/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt
index 94eac3bdf5..708d224cad 100644
--- a/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt
+++ b/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt
@@ -26,8 +26,10 @@ if (!extension_loaded('sockets')) {
$bytes_sent = socket_sendto($socket, $msg, $len, 0); // cause warning
$bytes_sent = socket_sendto($socket, $msg, $len, 0, $address);
if ($bytes_sent == -1) {
+ @unlink($address);
die('An error occured while sending to the socket');
} else if ($bytes_sent != $len) {
+ @unlink($address);
die($bytes_sent . ' bytes have been sent instead of the ' . $len . ' bytes expected');
}
@@ -35,13 +37,17 @@ if (!extension_loaded('sockets')) {
var_dump(socket_recvfrom($socket, $buf, 0, 0, $from)); // expect false
$bytes_received = socket_recvfrom($socket, $buf, 12, 0, $from);
if ($bytes_received == -1) {
+ @unlink($address);
die('An error occured while receiving from the socket');
} else if ($bytes_received != $len) {
+ @unlink($address);
die($bytes_received . ' bytes have been received instead of the ' . $len . ' bytes expected');
}
echo "Received $buf";
socket_close($socket);
+ @unlink($address);
+?>
--EXPECTF--
Warning: socket_create(): Unable to create socket [93]: Protocol not supported in %s on line %d