diff options
Diffstat (limited to 'test/socket/test_tcp.rb')
-rw-r--r-- | test/socket/test_tcp.rb | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/test/socket/test_tcp.rb b/test/socket/test_tcp.rb index aa07d96cf0..3aa7be82c3 100644 --- a/test/socket/test_tcp.rb +++ b/test/socket/test_tcp.rb @@ -8,22 +8,17 @@ end class TestTCPSocket < Test::Unit::TestCase def test_recvfrom assert false, "TODO: doesn't work on mswin32/64" if /mswin/ =~ RUBY_PLATFORM - c = s = nil svr = TCPServer.new("localhost", 0) th = Thread.new { c = svr.accept - Thread.pass - ObjectSpace.each_object(String) {|s| - s.replace "a" if s.length == 0x10000 and !s.frozen? - } - c.print("x"*0x1000) + c.write "foo" + c.close } addr = svr.addr sock = TCPSocket.open(addr[2], addr[1]) - assert_raise(RuntimeError, SocketError, "[ruby-dev:24705]") { - sock.recvfrom(0x10000) - } + assert_equal(["foo", nil], sock.recvfrom(0x10000)) ensure + th.kill th.join end end if defined?(TCPSocket) |