From: Eric Wong Date: Fri, 13 May 2011 01:59:44 +0000 (-0700) Subject: test_copy_stream: fix userspace buffering assumption X-Git-Tag: v4.0.0~3 X-Git-Url: https://repo.or.cz/w/ruby_io_splice.git/commitdiff_plain/83bdc390d98e9af4439c6db92679a9a84eb9f52a test_copy_stream: fix userspace buffering assumption And enable UNIX socket tests for this --- diff --git a/test/test_copy_stream.rb b/test/test_copy_stream.rb index 1858257..71d7cae 100644 --- a/test/test_copy_stream.rb +++ b/test/test_copy_stream.rb @@ -232,7 +232,6 @@ class TestIOCopyStreamCompat < Test::Unit::TestCase end def test_copy_stream_socket - return mkcdtmpdir { content = "foobar" @@ -280,13 +279,13 @@ class TestIOCopyStreamCompat < Test::Unit::TestCase } File.open("bigsrc") {|f| - assert_equal(bigcontent[0,100], f.read(100)) + assert_equal(bigcontent[0,100], f.sysread(100)) assert_equal(100, f.pos) with_socketpair {|s1, s2| t = Thread.new { s2.read } ret = IO::Splice.copy_stream(f, s1) assert_equal(bigcontent.bytesize-100, ret) - assert_equal(bigcontent.length, f.pos) + assert_equal(bigcontent.length, f.sysseek(0, IO::SEEK_CUR)) s1.close result = t.value assert_equal(bigcontent[100..-1], result)