diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-04 15:12:53 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-04 15:12:53 +0000 |
commit | e2f0aeb4973c81a54d38295bafc9d5b48cb0b3ef (patch) | |
tree | 3228e0457b774e7463dae04e8b0d48fc53884ede | |
parent | 1d46aa9fc1c78d235ca8a001505530bb60500663 (diff) | |
download | ruby-e2f0aeb4973c81a54d38295bafc9d5b48cb0b3ef.tar.gz |
relax tests for MacOS X.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/socket/test_socket.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb index 43c9fee11f..48b90b0eae 100644 --- a/test/socket/test_socket.rb +++ b/test/socket/test_socket.rb @@ -78,6 +78,8 @@ class TestSocket < Test::Unit::TestCase AddrInfo.tcp("127.0.0.1", addrinfo.ip_port) elsif addrinfo.ipv6? && addrinfo.ipv6_unspecified? AddrInfo.tcp("::1", addrinfo.ip_port) + elsif addrinfo.ipv6? && (ai = addrinfo.ipv6_to_ipv4) && ai.ip_address == "0.0.0.0" + AddrInfo.tcp("127.0.0.1", addrinfo.ip_port) else addrinfo end @@ -85,7 +87,8 @@ class TestSocket < Test::Unit::TestCase def test_tcp TCPServer.open(0) {|serv| - addr = tcp_unspecified_to_loopback(serv.local_address) + addr = serv.local_address + addr = tcp_unspecified_to_loopback(addr) addr.connect {|s1| s2 = serv.accept begin @@ -144,7 +147,11 @@ class TestSocket < Test::Unit::TestCase Socket.unix(path) {|s1| s2 = serv.accept begin - assert_equal(s2.remote_address.unix_path, s1.local_address.unix_path) + s2raddr = s2.remote_address + s1laddr = s1.local_address + assert(s2raddr.to_sockaddr.empty? || + s1laddr.to_sockaddr.empty? || + s2raddr.unix_path == s1laddr.unix_path) ensure s2.close end |