about summary refs log tree commit homepage
path: root/test/test_tcp_splice.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_tcp_splice.rb')
-rw-r--r--test/test_tcp_splice.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_tcp_splice.rb b/test/test_tcp_splice.rb
index 2ddbfcb..686333c 100644
--- a/test/test_tcp_splice.rb
+++ b/test/test_tcp_splice.rb
@@ -46,4 +46,21 @@ class TestTCPCopyStream < Test::Unit::TestCase
     bytes = IO::Splice.copy_stream(@accept, "/dev/null", expect)
     assert_equal expect, bytes
   end
+
+  def test_mega_splice
+    nr = 2000
+    buf = '0123456789abcdef' * 1024
+    expect = buf.size * nr
+    thr = Thread.new do
+      nr.times { @client.write(buf) }
+      @client.close
+    end
+    size_t_max = if (1 << 30).kind_of?(Bignum)
+      0xffffffff
+    else
+      0xffffffffffffffff
+    end
+    bytes = IO::Splice.copy_stream(@accept, "/dev/null", size_t_max)
+    assert_equal expect, bytes
+  end
 end