poll: fix over-allocation for poll(2)
[kgio.git] / test / test_connect_fd_leak.rb
blobf6a854392b56bc2ed4a728120d59ca780d34f4f3
1 require 'test/unit'
2 require 'io/nonblock'
3 $-w = true
4 require 'kgio'
6 class TestConnectFDLeak < Test::Unit::TestCase
8   def test_unix_socket
9     nr = 0
10     path = "/non/existent/path"
11     assert(! File.exist?(path), "#{path} should not exist")
12     assert_nothing_raised do
13       begin
14         sock = Kgio::UNIXSocket.new(path)
15       rescue Errno::ENOENT
16       end while (nr += 1) < 10000
17     end
18   end
19 end