[前][次][番号順一覧][スレッド一覧]

ruby-changes:19701

From: nobu <ko1@a...>
Date: Fri, 27 May 2011 22:37:45 +0900 (JST)
Subject: [ruby-changes:19701] nobu:r31746 (trunk): * test/ruby/test_io.rb (TestIO#test_ungetc2): get rid of busy loop.

nobu	2011-05-27 22:37:37 +0900 (Fri, 27 May 2011)

  New Revision: 31746

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31746

  Log:
    * test/ruby/test_io.rb (TestIO#test_ungetc2): get rid of busy loop.
    * test/ruby/test_signal.rb (TestSignal#test_signal2): ditto.

  Modified files:
    trunk/test/ruby/test_io.rb
    trunk/test/ruby/test_signal.rb

Index: test/ruby/test_signal.rb
===================================================================
--- test/ruby/test_signal.rb	(revision 31745)
+++ test/ruby/test_signal.rb	(revision 31746)
@@ -119,21 +119,21 @@
       Timeout.timeout(10) do
         x = false
         Process.kill(SignalException.new(:INT).signo, $$)
-        nil until x
+        sleep(0.01) until x
 
         x = false
         Process.kill("INT", $$)
-        nil until x
+        sleep(0.01) until x
 
         x = false
         Process.kill("SIGINT", $$)
-        nil until x
+        sleep(0.01) until x
 
         x = false
         o = Object.new
         def o.to_str; "SIGINT"; end
         Process.kill(o, $$)
-        nil until x
+        sleep(0.01) until x
       end
 
       assert_raise(ArgumentError) { Process.kill(Object.new, $$) }
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 31745)
+++ test/ruby/test_io.rb	(revision 31746)
@@ -827,7 +827,7 @@
   def test_ungetc2
     f = false
     pipe(proc do |w|
-      0 until f
+      Thread.pass until f
       w.write("1" * 10000)
       w.close
     end, proc do |r|

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]