diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-10-06 11:02:38 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-10-06 11:19:02 +0000 |
commit | 019543aa3a1074582a460b944ad5ebcddecd4394 (patch) | |
tree | bb24e015b373c5b9daca04e3497230058c8bcdf7 /test/test_buffer.rb | |
parent | b991345ff960229347b32eb1bfe9d7732441c19e (diff) | |
download | dtas-019543aa3a1074582a460b944ad5ebcddecd4394.tar.gz |
We do not need this for single sink situations (the common case) at all. We also do not need to check IO#nread for splice, either; we can just do non-blocking I/O. The only common path where we might still need it is the non-splice case with multiple sinks.
Diffstat (limited to 'test/test_buffer.rb')
-rw-r--r-- | test/test_buffer.rb | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/test/test_buffer.rb b/test/test_buffer.rb index d74cdce..13f4352 100644 --- a/test/test_buffer.rb +++ b/test/test_buffer.rb @@ -51,13 +51,9 @@ class TestBuffer < Testcase def test_broadcast_1 buf = new_buffer r, w = IO.pipe - assert_equal :wait_readable, buf.broadcast([w]) - assert_equal 0, buf.bytes_xfer buf.wr.write "HIHI" assert_equal :wait_readable, buf.broadcast([w]) assert_equal 4, buf.bytes_xfer - assert_equal :wait_readable, buf.broadcast([w]) - assert_equal 4, buf.bytes_xfer tmp = [w] r.close buf.wr.write "HIHI" @@ -90,20 +86,6 @@ class TestBuffer < Testcase a[1].nonblock = false b[0].read(b[0].nread) b[1].write(max) - t = Thread.new do - sleep 0.005 - [ a[0].read(max.size).size, b[0].read(max.size).size ] - end - assert_equal 5, buf.__broadcast_tee(blocked, [a[1], b[1]], 5) - assert_equal [a[1]], blocked - assert_equal [ max.size, max.size ], t.value - b[0].close - tmp = [a[1], b[1]] - - newerr = tmperr { assert_equal 5, buf.__broadcast_tee(blocked, tmp, 5) } - assert_equal [a[1]], blocked - assert_match(%r{dropping}, newerr.string) - assert_equal [a[1]], tmp end def test_broadcast @@ -115,8 +97,6 @@ class TestBuffer < Testcase assert_equal 5, buf.bytes_xfer assert_equal "HELLO", a[0].read(5) assert_equal "HELLO", b[0].read(5) - assert_equal :wait_readable, buf.broadcast([a[1], b[1]]) - assert_equal 5, buf.bytes_xfer return unless b[1].respond_to?(:pipe_size) |