Run separate process if the test uses GC.stress.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-04-18 01:08:34 +00:00
Родитель 5383ccd981
Коммит 9e56e14f50
1 изменённых файлов: 21 добавлений и 20 удалений

Просмотреть файл

@ -1093,28 +1093,29 @@ class TestBigDecimal < Test::Unit::TestCase
def test_split_under_gc_stress def test_split_under_gc_stress
bug3258 = '[ruby-dev:41213]' bug3258 = '[ruby-dev:41213]'
stress, GC.stress = GC.stress, true expect = 10.upto(20).map{|i|[1, "1", 10, i+1].inspect}
assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, expect, [], bug3258)
GC.stress = true
10.upto(20) do |i| 10.upto(20) do |i|
b = BigDecimal.new("1"+"0"*i) p BigDecimal.new("1"+"0"*i).split
assert_equal([1, "1", 10, i+1], b.split, bug3258)
end end
ensure EOS
GC.stress = stress
end end
def test_coerce_under_gc_stress def test_coerce_under_gc_stress
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal" assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], [])
under_gc_stress do expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
b = BigDecimal.new("1") b = BigDecimal.new("1")
GC.stress = true
10.times do 10.times do
begin begin
b.coerce(:too_long_to_embed_as_string) b.coerce(:too_long_to_embed_as_string)
rescue => e rescue => e
assert_instance_of TypeError, e raise unless e.is_a?(TypeError)
assert_equal expect, e.message raise "'\#{expect}' is expected, but '\#{e.message}'" unless e.message == expect
end end
end end
end EOS
end end
def test_INFINITY def test_INFINITY
@ -1178,17 +1179,17 @@ class TestBigDecimal < Test::Unit::TestCase
end end
def test_BigMath_exp_under_gc_stress def test_BigMath_exp_under_gc_stress
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal" assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], [])
under_gc_stress do expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
10.times do 10.times do
begin begin
BigMath.exp(:too_long_to_embed_as_string, 6) BigMath.exp(:too_long_to_embed_as_string, 6)
rescue => e rescue => e
assert_instance_of ArgumentError, e raise unless e.is_a?(ArgumentError)
assert_equal expect, e.message raise "'\#{expect}' is expected, but '\#{e.message}'" unless e.message == expect
end end
end end
end EOS
end end
def test_BigMath_log_with_nil def test_BigMath_log_with_nil
@ -1277,17 +1278,17 @@ class TestBigDecimal < Test::Unit::TestCase
end end
def test_BigMath_log_under_gc_stress def test_BigMath_log_under_gc_stress
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal" assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], [])
under_gc_stress do expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
10.times do 10.times do
begin begin
BigMath.log(:too_long_to_embed_as_string, 6) BigMath.log(:too_long_to_embed_as_string, 6)
rescue => e rescue => e
assert_instance_of ArgumentError, e raise unless e.is_a?(ArgumentError)
assert_equal expect, e.message raise "'\#{expect}' is expected, but '\#{e.message}'" unless e.message == expect
end end
end end
end EOS
end end
def test_dup def test_dup