summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorRyan Scott <[email protected]>2013-05-17 07:21:33 +1000
committerRyan Scott <[email protected]>2013-05-17 07:21:33 +1000
commit222918deae84ae8dda26aa769bf3cc6b68e3aeec (patch)
tree0446702a3a282491b754988d3e6433c8566b49c3 /test
parenta71bf5e3df961605aeb2712bb472bf3b0f1c0dd3 (diff)
downloadmruby-222918deae84ae8dda26aa769bf3cc6b68e3aeec.tar.gz
mruby-222918deae84ae8dda26aa769bf3cc6b68e3aeec.zip
First implementation of ObjectSpace moved outside of gc.c
Diffstat (limited to 'test')
-rw-r--r--test/t/objectspace.rb35
1 files changed, 0 insertions, 35 deletions
diff --git a/test/t/objectspace.rb b/test/t/objectspace.rb
deleted file mode 100644
index 06319dcbb..000000000
--- a/test/t/objectspace.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-
-assert('ObjectSpace.count_objects') do
- h = {}
- ObjectSpace.count_objects(h)
- assert_kind_of(Hash, h)
- assert_true(h.keys.all? {|x| x.is_a?(Symbol) || x.is_a?(Integer) })
- assert_true(h.values.all? {|x| x.is_a?(Integer) })
-
- h = ObjectSpace.count_objects
- assert_kind_of(Hash, h)
- assert_true(h.keys.all? {|x| x.is_a?(Symbol) || x.is_a?(Integer) })
- assert_true(h.values.all? {|x| x.is_a?(Integer) })
-
- assert_raise(TypeError) { ObjectSpace.count_objects(1) }
-
- h0 = {:MRB_TT_FOO=>1000}
- h = ObjectSpace.count_objects(h0)
- assert_false(h0.has_key?(:MRB_TT_FOO))
-
- GC.start
- h_after = {}
- h_before = ObjectSpace.count_objects
-
- objs = []
- 1000.times do
- objs << {}
- end
- objs = nil
- ObjectSpace.count_objects(h)
- GC.start
- ObjectSpace.count_objects(h_after)
-
- assert_equal(h_before[:MRB_TT_HASH] + 1000, h[:MRB_TT_HASH])
- assert_equal(h_before[:MRB_TT_HASH], h_after[:MRB_TT_HASH])
- end \ No newline at end of file