mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
getsockname returns "" on MacOS X
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
af19c66570
commit
a0261afccd
1 changed files with 6 additions and 4 deletions
|
@ -81,10 +81,12 @@ class TestUNIXSocket < Test::Unit::TestCase
|
|||
|
||||
def test_noname_unpack_sockaddr_un
|
||||
s1, s2 = UNIXSocket.pair
|
||||
assert_equal("", Socket.unpack_sockaddr_un(s1.getsockname))
|
||||
assert_equal("", Socket.unpack_sockaddr_un(s2.getsockname))
|
||||
assert_equal("", Socket.unpack_sockaddr_un(s1.getpeername))
|
||||
assert_equal("", Socket.unpack_sockaddr_un(s2.getpeername))
|
||||
n = nil
|
||||
assert_equal("", Socket.unpack_sockaddr_un(n)) if (n = s1.getsockname) != ""
|
||||
assert_equal("", Socket.unpack_sockaddr_un(n)) if (n = s1.getsockname) != ""
|
||||
assert_equal("", Socket.unpack_sockaddr_un(n)) if (n = s2.getsockname) != ""
|
||||
assert_equal("", Socket.unpack_sockaddr_un(n)) if (n = s1.getpeername) != ""
|
||||
assert_equal("", Socket.unpack_sockaddr_un(n)) if (n = s2.getpeername) != ""
|
||||
ensure
|
||||
s1.close
|
||||
s2.close
|
||||
|
|
Loading…
Reference in a new issue