summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-08 04:53:17 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-08 04:53:17 +0000
commit1145eb5247a1b7b8c2ad67405383fec9d1ef1ce2 (patch)
tree1656cb7651a2268d2e9597309ef741d1a4e184af /test
parent148d38ec7b8f854e07828e63932b55f7cc8753b1 (diff)
downloadruby-1145eb5247a1b7b8c2ad67405383fec9d1ef1ce2.tar.gz
ruby-1145eb5247a1b7b8c2ad67405383fec9d1ef1ce2.tar.xz
ruby-1145eb5247a1b7b8c2ad67405383fec9d1ef1ce2.zip
* ext/socket/raddrinfo.c (init_unix_addrinfo): add socktype argument.
(addrinfo_initialize): follow init_unix_addrinfo change. (addrinfo_s_unix): add optional argument: socktype git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/socket/test_addrinfo.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/socket/test_addrinfo.rb b/test/socket/test_addrinfo.rb
index 3ef69c5c5..00ed7f4e1 100644
--- a/test/socket/test_addrinfo.rb
+++ b/test/socket/test_addrinfo.rb
@@ -563,6 +563,15 @@ class TestSocketAddrinfo < Test::Unit::TestCase
assert_equal(0, ai.protocol)
end
+ def test_addrinfo_unix_dgram
+ ai = Addrinfo.unix("/tmp/sock", :DGRAM)
+ assert_equal("/tmp/sock", Socket.unpack_sockaddr_un(ai))
+ assert_equal(Socket::AF_UNIX, ai.afamily)
+ assert_equal(Socket::PF_UNIX, ai.pfamily)
+ assert_equal(Socket::SOCK_DGRAM, ai.socktype)
+ assert_equal(0, ai.protocol)
+ end
+
def test_addrinfo_unix_path
ai = Addrinfo.unix("/tmp/sock1")
assert_equal("/tmp/sock1", ai.unix_path)