aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_gc.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-10 16:55:32 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-10 16:55:32 +0000
commitc8c99520668f4a92f620ede01e5af2827a29b3fa (patch)
tree74ec9b06778912e02f76b5cc362bf0ead75d90ef /test/ruby/test_gc.rb
parent9ada2641c6804218503f7b3bc5afdbe14601fde1 (diff)
downloadruby-c8c99520668f4a92f620ede01e5af2827a29b3fa.tar.gz
* gc.c: invoke GC before memory allocation (xmalloc/xrealloc)
when GC.stress = true. [Bug #9859] * test/ruby/test_gc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_gc.rb')
-rw-r--r--test/ruby/test_gc.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 00a49418ac..5181e9db9f 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -312,4 +312,22 @@ class TestGc < Test::Unit::TestCase
def test_verify_internal_consistency
assert_nil(GC.verify_internal_consistency)
end
+
+ def test_gc_stress_on_realloc
+ assert_normal_exit(<<-'end;', '[Bug #9859]')
+ class C
+ def initialize
+ @a = nil
+ @b = nil
+ @c = nil
+ @d = nil
+ @e = nil
+ @f = nil
+ end
+ end
+
+ GC.stress = true
+ C.new
+ end;
+ end
end