test fixes

This commit is contained in:
Stanislav Malyshev 2011-12-26 03:22:07 +00:00
parent 2f15c1d717
commit d42917b605
5 changed files with 12 additions and 6 deletions

View File

@ -4,6 +4,7 @@ Bug #31422 (No Error-Logging on SoapServer-Side)
<?php require_once('skipif.inc'); ?> <?php require_once('skipif.inc'); ?>
--INI-- --INI--
log_errors=1 log_errors=1
error_log=
--FILE-- --FILE--
<?php <?php
function Add($x,$y) { function Add($x,$y) {

View File

@ -8,6 +8,8 @@ if (!extension_loaded('sockets')) {
if (!defined('IPPROTO_IPV6')) { if (!defined('IPPROTO_IPV6')) {
die('skip IPv6 not available.'); die('skip IPv6 not available.');
} }
$level = IPPROTO_IPV6;
$s = socket_create($domain, SOCK_DGRAM, SOL_UDP) or die("skip Can not create socket");
if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) { if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) {
die("skip interface 1 either doesn't exist or has no ipv6 address"); die("skip interface 1 either doesn't exist or has no ipv6 address");
} }

View File

@ -13,7 +13,7 @@ $so = socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array(
"group" => '224.0.0.23', "group" => '224.0.0.23',
"interface" => "lo", "interface" => "lo",
)); ));
if ($br === false) if ($so === false)
die("SKIP joining group 224.0.0.23 on interface lo failed"); die("SKIP joining group 224.0.0.23 on interface lo failed");
--FILE-- --FILE--
<?php <?php

View File

@ -30,7 +30,9 @@ $options_2 = array("l_onoff" => 1);
var_dump(socket_set_option( $socket, SOL_SOCKET, SO_LINGER, $options_2)); var_dump(socket_set_option( $socket, SOL_SOCKET, SO_LINGER, $options_2));
var_dump($retval_2); var_dump($retval_2);
var_dump($retval_3 === $options); var_dump($retval_3["l_linger"] === $options["l_linger"]);
// value of l_onoff is not always 1, Darwin returns 128
var_dump((bool)$retval_3["l_onoff"] === (bool)$options["l_onoff"]);
socket_close($socket); socket_close($socket);
?> ?>
@ -42,6 +44,7 @@ Warning: socket_set_option(): no key "l_linger" passed in optval in %s on line %
bool(false) bool(false)
bool(true) bool(true)
bool(true) bool(true)
bool(true)
--CREDITS-- --CREDITS--
Moritz Neuhaeuser, info@xcompile.net Moritz Neuhaeuser, info@xcompile.net
PHP Testfest Berlin 2009-05-10 PHP Testfest Berlin 2009-05-10

View File

@ -4,10 +4,10 @@ Bug #54623: Segfault when when writing to a persistent socket after closing a co
<?php <?php
$sock = pfsockopen('udp://127.0.0.1', '63844'); $sock = pfsockopen('udp://127.0.0.1', '63844');
var_dump((int)$sock); var_dump((int)$sock);
fwrite($sock, "1"); @fwrite($sock, "1");
$sock2 = pfsockopen('udp://127.0.0.1', '63844'); $sock2 = pfsockopen('udp://127.0.0.1', '63844');
var_dump((int)$sock2); var_dump((int)$sock2);
fwrite($sock2, "2"); @fwrite($sock2, "2");
fclose($sock2); fclose($sock2);
fwrite($sock, "3"); fwrite($sock, "3");
--EXPECTF-- --EXPECTF--