aboutsummaryrefslogtreecommitdiffstats
path: root/test/objspace
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-28 20:23:21 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-28 20:23:21 +0000
commit8121a4f5a856b94345f68dd60a8873afc5d1620f (patch)
treeabee9465260a30d3b66256afc2195f2596db489e /test/objspace
parent8bf968ff052df72167e7354f74fc81214050ec4a (diff)
downloadruby-8121a4f5a856b94345f68dd60a8873afc5d1620f.tar.gz
* 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
Diffstat (limited to 'test/objspace')
-rw-r--r--test/objspace/test_objspace.rb9
1 files changed, 7 insertions, 2 deletions
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