Project

General

Profile

Bug #4289 » 0001-test-socket-test_unix-fix-test-failures-from-rb_mod_.patch

normalperson (Eric Wong), 04/07/2011 11:44 AM

View differences:

test/socket/test_unix.rb
def test_dgram_pair
s1, s2 = UNIXSocket.pair(Socket::SOCK_DGRAM)
assert_raise(Errno::EAGAIN) { s1.recv_nonblock(10) }
e = assert_raise(IO::WaitReadable) { s1.recv_nonblock(10) }
assert_kind_of Errno::EAGAIN, e
s2.send("", 0)
s2.send("haha", 0)
s2.send("", 0)
......
assert_equal("haha", s1.recv(10))
assert_equal("", s1.recv(10))
assert_equal("", s1.recv(10))
assert_raise(Errno::EAGAIN) { s1.recv_nonblock(10) }
e = assert_raise(IO::WaitReadable) { s1.recv_nonblock(10) }
assert_kind_of Errno::EAGAIN, e
ensure
s1.close if s1
s2.close if s2
(4-4/7)