mirror of
https://github.com/php/php-src.git
synced 2024-12-01 13:54:10 +08:00
test fixes
This commit is contained in:
parent
2f15c1d717
commit
d42917b605
@ -4,6 +4,7 @@ Bug #31422 (No Error-Logging on SoapServer-Side)
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--INI--
|
||||
log_errors=1
|
||||
error_log=
|
||||
--FILE--
|
||||
<?php
|
||||
function Add($x,$y) {
|
||||
|
@ -8,6 +8,8 @@ if (!extension_loaded('sockets')) {
|
||||
if (!defined('IPPROTO_IPV6')) {
|
||||
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) {
|
||||
die("skip interface 1 either doesn't exist or has no ipv6 address");
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ $so = socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array(
|
||||
"group" => '224.0.0.23',
|
||||
"interface" => "lo",
|
||||
));
|
||||
if ($br === false)
|
||||
if ($so === false)
|
||||
die("SKIP joining group 224.0.0.23 on interface lo failed");
|
||||
--FILE--
|
||||
<?php
|
||||
|
@ -1,8 +1,8 @@
|
||||
--TEST--
|
||||
Test if socket_set_option() works, option:SO_SEOLINGER
|
||||
--DESCRIPTION--
|
||||
-wrong params
|
||||
-set/get params comparison
|
||||
-wrong params
|
||||
-set/get params comparison
|
||||
-l_linger not given
|
||||
--SKIPIF--
|
||||
<?php
|
||||
@ -30,7 +30,9 @@ $options_2 = array("l_onoff" => 1);
|
||||
var_dump(socket_set_option( $socket, SOL_SOCKET, SO_LINGER, $options_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);
|
||||
?>
|
||||
@ -42,6 +44,7 @@ Warning: socket_set_option(): no key "l_linger" passed in optval in %s on line %
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
--CREDITS--
|
||||
Moritz Neuhaeuser, info@xcompile.net
|
||||
PHP Testfest Berlin 2009-05-10
|
||||
|
@ -4,10 +4,10 @@ Bug #54623: Segfault when when writing to a persistent socket after closing a co
|
||||
<?php
|
||||
$sock = pfsockopen('udp://127.0.0.1', '63844');
|
||||
var_dump((int)$sock);
|
||||
fwrite($sock, "1");
|
||||
@fwrite($sock, "1");
|
||||
$sock2 = pfsockopen('udp://127.0.0.1', '63844');
|
||||
var_dump((int)$sock2);
|
||||
fwrite($sock2, "2");
|
||||
@fwrite($sock2, "2");
|
||||
fclose($sock2);
|
||||
fwrite($sock, "3");
|
||||
--EXPECTF--
|
||||
|
Loading…
Reference in New Issue
Block a user