summaryrefslogtreecommitdiff
path: root/test/rinda
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-01 01:21:18 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-01 01:21:18 +0000
commitf64541d7bd37590207b43868edc6f54811a4906d (patch)
tree170402404e15e254f33f8c7827f3d2506c9fa6b8 /test/rinda
parent28229e4a77be19370f09ace0c03d20f333c15063 (diff)
Close FDs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rinda')
-rw-r--r--test/rinda/test_rinda.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb
index 205ac23e556..eb9df373c32 100644
--- a/test/rinda/test_rinda.rb
+++ b/test/rinda/test_rinda.rb
@@ -754,6 +754,8 @@ class TestRingFinger < Test::Unit::TestCase
v4 = @rf.make_socket('127.0.0.1')
assert(v4.getsockopt(:SOL_SOCKET, :SO_BROADCAST).bool)
+ ensure
+ v4.close if v4
end
def test_make_socket_ipv4_multicast
@@ -761,6 +763,8 @@ class TestRingFinger < Test::Unit::TestCase
assert_equal(1, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_LOOP).ipv4_multicast_loop)
assert_equal(1, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL).ipv4_multicast_ttl)
+ ensure
+ v4mc.close if v4mc
end
def test_make_socket_ipv6_multicast
@@ -774,12 +778,16 @@ class TestRingFinger < Test::Unit::TestCase
assert_equal(1, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_LOOP).int)
assert_equal(1, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_HOPS).int)
+ ensure
+ v6mc.close if v6mc
end
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).ipv4_multicast_ttl)
+ ensure
+ v4mc.close if v4mc
end
def test_make_socket_ipv6_multicast_hops
@@ -792,6 +800,8 @@ class TestRingFinger < Test::Unit::TestCase
v6mc = @rf.make_socket("ff02::1%#{ifaddr.name}")
end
assert_equal(2, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_HOPS).int)
+ ensure
+ v6mc.close if v6mc
end
end