From b1b4724ea0c6e96e15d0f448b8185972e108238b Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 9 Oct 2013 08:39:28 +0000 Subject: [PATCH] test_tracepoint.rb: include zombies * test/-ext-/tracepoint/test_tracepoint.rb (test_tracks_objspace_count): free count should include zombies. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/-ext-/tracepoint/test_tracepoint.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/-ext-/tracepoint/test_tracepoint.rb b/test/-ext-/tracepoint/test_tracepoint.rb index 7d079779a8..a4cb2882ed 100644 --- a/test/-ext-/tracepoint/test_tracepoint.rb +++ b/test/-ext-/tracepoint/test_tracepoint.rb @@ -22,7 +22,9 @@ class TestTracepointObj < Test::Unit::TestCase assert_equal 2, newobjs.size assert_equal 'foobar', newobjs[0] assert_equal Object, newobjs[1].class + end + def test_tracks_objspace_count stat1 = {} stat2 = {} GC.disable @@ -40,7 +42,7 @@ class TestTracepointObj < Test::Unit::TestCase assert_operator stat2[:total_allocated_object] - stat1[:total_allocated_object], :>=, newobj_count assert_operator 1_000_000, :<=, newobj_count - assert_operator stat2[:total_freed_object] - stat1[:total_freed_object], :>=, free_count + assert_operator stat2[:total_freed_object] + stat2[:heap_final_num] - stat1[:total_freed_object], :>=, free_count assert_operator stat2[:count] - stat1[:count], :==, gc_start_count assert_operator gc_start_count, :>=, gc_end_count