From 80329d3a66bf007d85a35c624d6514b0ddc814ca Mon Sep 17 00:00:00 2001 From: nari Date: Mon, 18 Mar 2013 15:30:02 +0000 Subject: * 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/trunk@39812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_gc.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby/test_gc.rb') diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 90c47875ee..b1e52fc58e 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