From 03e6d4eadbe402422505e1a0e0167de1f050c212 Mon Sep 17 00:00:00 2001 From: nagachika Date: Sat, 6 Apr 2013 17:57:48 +0000 Subject: merge revision(s) 39812: [Backport #8147] * gc.c: Improve accuracy of objspace_live_num() and allocated/freed counters. patched by tmm1(Aman Gupta). [Bug #8092] [ruby-core:53392] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_gc.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 793ef3918e..62ae7ae5be 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -64,6 +64,12 @@ class TestGc < Test::Unit::TestCase assert_equal(arg, res) assert_equal(false, res.empty?) assert_kind_of(Integer, res[:count]) + + stat, count = {}, {} + GC.start + GC.stat(stat) + ObjectSpace.count_objects(count) + assert_equal(count[:TOTAL]-count[:FREE], stat[:heap_live_num]) end def test_singleton_method -- cgit v1.2.3