1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use custom methods for values whose type is different on platforms

Use Socket::Option#ip_multicast_loop and Socket::Option#ip_multicast_ttl
instead of Socket::Option#int because NetBSD's size is byte though
others' is int.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2013-05-31 18:21:00 +00:00
parent a78e45b5fe
commit 984a34bc3f

View file

@ -657,8 +657,8 @@ class TestRingFinger < Test::Unit::TestCase
def test_make_socket_ipv4_multicast
v4mc = @rf.make_socket('239.0.0.1')
assert_equal(1, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_LOOP).int)
assert_equal(1, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL).int)
assert_equal(1, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_LOOP).ip_multicast_loop)
assert_equal(1, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL).ip_multicast_ttl)
end
def test_make_socket_ipv6_multicast
@ -672,7 +672,7 @@ class TestRingFinger < Test::Unit::TestCase
def test_make_socket_ipv4_multicast_hops
@rf.multicast_hops = 2
v4mc = @rf.make_socket('239.0.0.1')
assert_equal(2, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL).int)
assert_equal(2, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL).ip_multicast_ttl)
end
def test_make_socket_ipv6_multicast_hops