File: test_connect_fd_leak.rb

package info (click to toggle)
ruby-kgio 2.11.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 512 kB
  • sloc: ruby: 2,790; ansic: 2,020; sh: 32; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 383 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'test/unit'
require 'io/nonblock'
$-w = true
require 'kgio'

class TestConnectFDLeak < Test::Unit::TestCase

  def test_unix_socket
    nr = 0
    path = "/non/existent/path"
    assert(! File.exist?(path), "#{path} should not exist")
    begin
      sock = Kgio::UNIXSocket.new(path)
    rescue Errno::ENOENT
    end while (nr += 1) < 10000
    sock.close if sock
  end
end