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

ruby-changes:26468

From: nobu <ko1@a...>
Date: Fri, 21 Dec 2012 16:35:54 +0900 (JST)
Subject: [ruby-changes:26468] nobu:r38519 (trunk): test_thread.rb: flush before SystemStackError

nobu	2012-12-21 16:35:47 +0900 (Fri, 21 Dec 2012)

  New Revision: 38519

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

  Log:
    test_thread.rb: flush before SystemStackError
    
    * test/ruby/test_thread.rb (TestThread#test_stack_size): need to flush
      before SystemStackError.

  Modified files:
    trunk/test/ruby/test_thread.rb

Index: test/ruby/test_thread.rb
===================================================================
--- test/ruby/test_thread.rb	(revision 38518)
+++ test/ruby/test_thread.rb	(revision 38519)
@@ -1,3 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L1
+# -*- coding: us-ascii -*-
 require 'test/unit'
 require 'thread'
 require_relative 'envutil'
@@ -890,7 +891,7 @@ Thread.new(Thread.current) {|mth| https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L891
     assert(h_default[:thread_machine_stack_size] <= h_large[:thread_machine_stack_size])
 
     # check VM machine stack size
-    script = 'def rec; print "."; rec; end; rec'
+    script = 'def rec; print "."; STDOUT.flush; rec; end; rec'
     size_default = invoke_rec script, nil, nil
     assert(size_default > 0, size_default.to_s)
     size_0 = invoke_rec script, 0, nil
@@ -902,7 +903,7 @@ Thread.new(Thread.current) {|mth| https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L903
 
     # check machine stack size
     # Note that machine stack size may not change size (depend on OSs)
-    script = 'def rec; print "."; 1.times{1.times{1.times{rec}}}; end; Thread.new{rec}.join'
+    script = 'def rec; print "."; STDOUT.flush; 1.times{1.times{1.times{rec}}}; end; Thread.new{rec}.join'
     vm_stack_size = 1024 * 1024
     size_default = invoke_rec script, vm_stack_size, nil
     size_0 = invoke_rec script, vm_stack_size, 0

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

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