summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-20 11:19:09 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-20 11:19:09 +0000
commitbd3cdcf3940d1647bf86a3cce1e770a8be31e091 (patch)
tree6df8462e45a98111a5098801adc579ae75d02f45 /test
parent9ffca4659b0cb91c6253eeb1e0c12978e9567d1a (diff)
* ext/socket/socket.c (socket_s_list_ip_address): new method.
(sockaddr_obj): new function. * ext/socket/rubysocket.h: include ifaddrs.h, sys/ioctl.h, sys/sockio.h, net/if.h if available. (addrinfo_new): declared. * ext/socket/raddrinfo.c (addrinfo_new): exported. * ext/socket/extconf.rb: check ifaddrs.h, sys/ioctl.h, sys/sockio.h, net/if.h and getifaddrs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/socket/test_socket.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index d2aab5f1f3..d3c3840464 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -54,4 +54,16 @@ class TestSocket < Test::Unit::TestCase
def test_getnameinfo
assert_raise(SocketError) { Socket.getnameinfo(["AF_UNIX", 80, "0.0.0.0"]) }
end
+
+ def test_list_ip_address
+ begin
+ list = Socket.list_ip_address
+ rescue NotImplementedError
+ return
+ end
+ list.each {|ai|
+ assert_instance_of(AddrInfo, ai)
+ assert(ai.ip?)
+ }
+ end
end if defined?(Socket)