From 8121a4f5a856b94345f68dd60a8873afc5d1620f Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 28 Oct 2010 20:23:21 +0000 Subject: * ext/objspace/objspace.c (ObjectSpace.memsize_of_all): rename ObjectSpace.total_memsize_of_all_objects() to ObjectSpace.memsize_of_all([klass]). Accept Class object to filter the objects. * test/objspace/test_objspace.rb: fix test for above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/objspace/test_objspace.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index ceb9650b6e..04a33817de 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -19,8 +19,13 @@ class TestObjSpace < Test::Unit::TestCase assert_kind_of(Integer, ObjectSpace.memsize_of(Struct.new(:a))) end - def test_total_memsize_of_all_objects - assert_kind_of(Integer, ObjectSpace.total_memsize_of_all_objects) + def test_memsize_of_all + assert_kind_of(Integer, a = ObjectSpace.memsize_of_all) + assert_kind_of(Integer, b = ObjectSpace.memsize_of_all(String)) + assert(a > b) + assert(a > 0) + assert(b > 0) + assert_raise(TypeError) {ObjectSpace.memsize_of_all('error')} end def test_count_objects_size -- cgit v1.2.3