summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-04 15:12:53 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-04 15:12:53 +0000
commitd961c653b92b7b19b797ecef03270346035133eb (patch)
tree3228e0457b774e7463dae04e8b0d48fc53884ede
parentb2c9a6d13341a26d974030971472845f6d9ab230 (diff)
downloadruby-d961c653b92b7b19b797ecef03270346035133eb.tar.gz
ruby-d961c653b92b7b19b797ecef03270346035133eb.tar.xz
ruby-d961c653b92b7b19b797ecef03270346035133eb.zip
relax tests for MacOS X.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/socket/test_socket.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index 43c9fee11..48b90b0ea 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