зеркало из https://github.com/github/ruby.git
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:
Родитель
5383ccd981
Коммит
9e56e14f50
|
@ -1093,28 +1093,29 @@ class TestBigDecimal < Test::Unit::TestCase
|
|||
|
||||
def test_split_under_gc_stress
|
||||
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|
|
||||
b = BigDecimal.new("1"+"0"*i)
|
||||
assert_equal([1, "1", 10, i+1], b.split, bug3258)
|
||||
p BigDecimal.new("1"+"0"*i).split
|
||||
end
|
||||
ensure
|
||||
GC.stress = stress
|
||||
EOS
|
||||
end
|
||||
|
||||
def test_coerce_under_gc_stress
|
||||
assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], [])
|
||||
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
|
||||
under_gc_stress do
|
||||
b = BigDecimal.new("1")
|
||||
GC.stress = true
|
||||
10.times do
|
||||
begin
|
||||
b.coerce(:too_long_to_embed_as_string)
|
||||
rescue => e
|
||||
assert_instance_of TypeError, e
|
||||
assert_equal expect, e.message
|
||||
end
|
||||
raise unless e.is_a?(TypeError)
|
||||
raise "'\#{expect}' is expected, but '\#{e.message}'" unless e.message == expect
|
||||
end
|
||||
end
|
||||
EOS
|
||||
end
|
||||
|
||||
def test_INFINITY
|
||||
|
@ -1178,17 +1179,17 @@ class TestBigDecimal < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_BigMath_exp_under_gc_stress
|
||||
assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], [])
|
||||
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
|
||||
under_gc_stress do
|
||||
10.times do
|
||||
begin
|
||||
BigMath.exp(:too_long_to_embed_as_string, 6)
|
||||
rescue => e
|
||||
assert_instance_of ArgumentError, e
|
||||
assert_equal expect, e.message
|
||||
end
|
||||
raise unless e.is_a?(ArgumentError)
|
||||
raise "'\#{expect}' is expected, but '\#{e.message}'" unless e.message == expect
|
||||
end
|
||||
end
|
||||
EOS
|
||||
end
|
||||
|
||||
def test_BigMath_log_with_nil
|
||||
|
@ -1277,17 +1278,17 @@ class TestBigDecimal < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_BigMath_log_under_gc_stress
|
||||
assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], [])
|
||||
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
|
||||
under_gc_stress do
|
||||
10.times do
|
||||
begin
|
||||
BigMath.log(:too_long_to_embed_as_string, 6)
|
||||
rescue => e
|
||||
assert_instance_of ArgumentError, e
|
||||
assert_equal expect, e.message
|
||||
end
|
||||
raise unless e.is_a?(ArgumentError)
|
||||
raise "'\#{expect}' is expected, but '\#{e.message}'" unless e.message == expect
|
||||
end
|
||||
end
|
||||
EOS
|
||||
end
|
||||
|
||||
def test_dup
|
||||
|
|
Загрузка…
Ссылка в новой задаче