summaryrefslogtreecommitdiff
path: root/test/objspace
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-14 17:02:56 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-14 17:02:56 +0000
commitd0e86105829192d982016d5e8badea950a76b6dd (patch)
treee6e7a9bc352f4f97a69f4259033d177bd8164e4e /test/objspace
parent852acc92db68eaca3c5d9d76c8056fde9fe00fbe (diff)
* test/objspace/test_objspace.rb
(test_trace_object_allocations_start_stop_clear): clear object allocation table first to get rid of erronous detection for obj3. [ruby-dev:49095] [Bug #11271] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/objspace')
-rw-r--r--test/objspace/test_objspace.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb
index 2acc354..820edc7 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -177,6 +177,8 @@ class TestObjSpace < Test::Unit::TestCase
end
def test_trace_object_allocations_start_stop_clear
+ ObjectSpace.trace_object_allocations_clear # clear object_table to get rid of erronous detection for obj3
+ GC.disable # suppress potential object reuse. see [Bug #11271]
begin
ObjectSpace.trace_object_allocations_start
begin
@@ -207,6 +209,8 @@ class TestObjSpace < Test::Unit::TestCase
assert_equal(nil, ObjectSpace.allocation_sourcefile(obj1))
assert_equal(nil, ObjectSpace.allocation_sourcefile(obj2))
assert_equal(nil, ObjectSpace.allocation_sourcefile(obj3))
+ ensure
+ GC.enable
end
def test_dump_flags