diff options
author | Xinchen Hui <laruence@php.net> | 2012-04-21 16:02:25 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2012-04-21 16:02:25 +0800 |
commit | 2e9eb5e32fb489d73cb336730104d507b20d9652 (patch) | |
tree | b13c0b20fa0b1cb46adde5e73f45ee220cc16d83 /ext/standard/tests/streams/bug60106.phpt | |
parent | dd34fe52b93dd48b9667dd75f07d0a48681c3dca (diff) | |
download | php-git-2e9eb5e32fb489d73cb336730104d507b20d9652.tar.gz |
Fix test
Reported by cjones
Diffstat (limited to 'ext/standard/tests/streams/bug60106.phpt')
-rw-r--r-- | ext/standard/tests/streams/bug60106.phpt | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/ext/standard/tests/streams/bug60106.phpt b/ext/standard/tests/streams/bug60106.phpt index f96c5b4342..1b36af1a3d 100644 --- a/ext/standard/tests/streams/bug60106.phpt +++ b/ext/standard/tests/streams/bug60106.phpt @@ -7,12 +7,17 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) ?> --FILE-- <?php - error_reporting(E_ALL | E_NOTICE); - stream_socket_server("unix:///tmp/" . str_repeat("a", 512)); +error_reporting(E_ALL | E_NOTICE); +$socket_file = "/tmp/" . str_repeat("a", 512); +function get_truncated_socket_filename($errno, $errmsg, $file, $line) { + global $socket_file; + print_r ($errmsg); + preg_match("#maximum allowed length of (\d+) bytes#", $errmsg, $matches); + $socket_file = substr($socket_file, 0, intval($matches[1]) - 1); +} +set_error_handler("get_truncated_socket_filename", E_NOTICE); +stream_socket_server("unix://" . $socket_file); +unlink($socket_file); ?> -===DONE=== --EXPECTF-- -Notice: stream_socket_server(): socket path exceeded the maximum allowed length of %d bytes and was truncated in %sbug60106.php on line %d - -Warning: stream_socket_server(): unable to connect to unix:///tmp/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (Unknown error) in %sbug60106.php on line %d -===DONE=== +stream_socket_server(): socket path exceeded the maximum allowed length of %d bytes and was truncated |