From 61b062ba6dac3d7583096bf25158d187413c2029 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 9 Sep 2011 01:22:06 +0000 Subject: * thread.c (rb_thread_select): fix a typo to initialize efds properly. [Bug #5299] [ruby-core:39380] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/-ext-/old_thread_select/test_old_thread_select.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'test/-ext-') diff --git a/test/-ext-/old_thread_select/test_old_thread_select.rb b/test/-ext-/old_thread_select/test_old_thread_select.rb index c9b55c81ee..b40f3a429b 100644 --- a/test/-ext-/old_thread_select/test_old_thread_select.rb +++ b/test/-ext-/old_thread_select/test_old_thread_select.rb @@ -23,6 +23,17 @@ class TestOldThreadSelect < Test::Unit::TestCase end end + def test_old_select_error_timeout + bug5299 = '[ruby-core:39380]' + with_pipe do |r, w| + t0 = Time.now + rc = IO.old_thread_select(nil, nil, [r.fileno], 0.001) + diff = Time.now - t0 + assert_equal 0, rc, bug5299 + assert_operator diff, :>=, 0.001, "returned too early" + end + end + def test_old_select_read_write_check with_pipe do |r, w| w.syswrite('.') @@ -63,7 +74,7 @@ class TestOldThreadSelect < Test::Unit::TestCase assert_equal 0, rc assert_equal true, thr.value assert_not_equal false, received, "SIGINT not received" - ensure - trap(:INT, "DEFAULT") + ensure + trap(:INT, "DEFAULT") end end -- cgit v1.2.3