aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_gc.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-30 21:55:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-30 21:55:59 +0000
commita92374677c683e78ba24013c6c7d60bf133e0c26 (patch)
tree441bc46376c8fc29c66826a6d244d9ee6ad3f412 /test/ruby/test_gc.rb
parent1cd98eb928339ac50e5b309eccfab928f350e1b9 (diff)
downloadruby-a92374677c683e78ba24013c6c7d60bf133e0c26.tar.gz
gc.c: avoid inadvertent pin-down
* gc.c (gc_info_decode): get rid of inadvertent dynamic symbol pin-down, and preserve encoding in error messages. also should not use RSTRING_PTR macro on function calls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_gc.rb')
-rw-r--r--test/ruby/test_gc.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 0c8ff62cae..b1933edb56 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -95,6 +95,10 @@ class TestGc < Test::Unit::TestCase
assert_equal(count[:FREE], stat[:heap_free_slot])
end
+ def test_stat_argument
+ assert_raise_with_message(ArgumentError, /\u{30eb 30d3 30fc}/) {GC.stat(:"\u{30eb 30d3 30fc}")}
+ end
+
def test_stat_single
stat = GC.stat
assert_equal stat[:count], GC.stat(:count)
@@ -124,6 +128,7 @@ class TestGc < Test::Unit::TestCase
assert_not_empty info
assert_equal info[:gc_by], GC.latest_gc_info(:gc_by)
assert_raises(ArgumentError){ GC.latest_gc_info(:invalid) }
+ assert_raise_with_message(ArgumentError, /\u{30eb 30d3 30fc}/) {GC.latest_gc_info(:"\u{30eb 30d3 30fc}")}
end
def test_singleton_method