summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-29 14:48:32 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-29 14:48:32 +0000
commit921f484775ea2a83462f354b8fff7fc1d5fe1297 (patch)
tree0633b4a90b5aaf32b7a3f0b26c68389c9af54837 /test
parentf895d9f59462077fe57e2cddb71b6aeb827e3151 (diff)
merges r28401 and r28402 from trunk into ruby_1_9_2.
-- * ext/socket/raddrinfo.c (ruby_getaddrinfo__darwin): new workaround for getaddrinfo problem on Mac OS X Snow Leopard. [ruby-core:29427] patch by Wataru Kimura. [ruby-core:30842] -- add a comment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/socket/test_socket.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index 999976b999..179e83f316 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -60,6 +60,15 @@ class TestSocket < Test::Unit::TestCase
assert_raise(SocketError) { Socket.getaddrinfo("www.kame.net", 80, "AF_UNIX") }
end
+ def test_getaddrinfo_raises_no_errors_on_port_argument_of_0 # [ruby-core:29427]
+ assert_nothing_raised('[ruby-core:29427]'){ Socket.getaddrinfo('localhost', 0, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) }
+ assert_nothing_raised('[ruby-core:29427]'){ Socket.getaddrinfo('localhost', '0', Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) }
+ assert_nothing_raised('[ruby-core:29427]'){ Socket.getaddrinfo('localhost', '00', Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) }
+ assert_raise(SocketError, '[ruby-core:29427]'){ Socket.getaddrinfo(nil, nil, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) }
+ assert_nothing_raised('[ruby-core:29427]'){ TCPServer.open('localhost', 0) {} }
+ end
+
+
def test_getnameinfo
assert_raise(SocketError) { Socket.getnameinfo(["AF_UNIX", 80, "0.0.0.0"]) }
end