mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/io/nonblock/test_flush.rb (test_flush): try pipe and
socketpair. [ruby-dev:41517] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3110939641
commit
cb4bba380b
2 changed files with 16 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Jun 3 13:05:15 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* test/io/nonblock/test_flush.rb (test_flush): try pipe and
|
||||||
|
socketpair. [ruby-dev:41517]
|
||||||
|
|
||||||
Thu Jun 3 09:39:54 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
Thu Jun 3 09:39:54 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* ext/dl/dl.h (DLSTACK_TYPE): type of stack is same as VALUE.
|
* ext/dl/dl.h (DLSTACK_TYPE): type of stack is same as VALUE.
|
||||||
|
|
|
@ -7,8 +7,17 @@ end
|
||||||
|
|
||||||
class TestIONonblock < Test::Unit::TestCase
|
class TestIONonblock < Test::Unit::TestCase
|
||||||
def test_flush
|
def test_flush
|
||||||
r,w = IO.pipe
|
flush_test(*IO.pipe) or
|
||||||
w.nonblock = true
|
(require 'socket'; flush_test(*Socket.pair(:INET, :STREAM))) or
|
||||||
|
skip "nonblocking IO did not work"
|
||||||
|
end
|
||||||
|
|
||||||
|
def flush_test(r, w)
|
||||||
|
begin
|
||||||
|
w.nonblock = true
|
||||||
|
rescue Errno::EBADF
|
||||||
|
return false
|
||||||
|
end
|
||||||
w.sync = false
|
w.sync = false
|
||||||
w << "b"
|
w << "b"
|
||||||
w.flush
|
w.flush
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue