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