diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-05 11:54:48 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-05 11:54:48 +0000 |
commit | 5d0c0c192cc865d8b1848667d554a848274133e7 (patch) | |
tree | ac7be4a6f84223ac474546f22524d13fb0fb946d /test/ruby | |
parent | 8c36fa1316dfe670534a8f2ef532b866e1ca1fdb (diff) |
merges r28869 from trunk into ruby_1_9_2.
--
* complex.c (nucomp_marshal_load): should check the argument.
[ruby-core:31622]
* rational.c (nurat_marshal_load): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_complex.rb | 5 | ||||
-rw-r--r-- | test/ruby/test_rand.rb | 7 | ||||
-rw-r--r-- | test/ruby/test_rational.rb | 5 |
3 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index f6d65de6de..b2894610f7 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -633,6 +633,11 @@ class Complex_Test < Test::Unit::TestCase assert_equal(c, c2) assert_instance_of(Complex, c2) end + + bug3656 = '[ruby-core:31622]' + assert_raise(TypeError, bug3656) { + Complex(1,2).marshal_load(0) + } end def test_parse diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb index e22e532c53..43120dabd1 100644 --- a/test/ruby/test_rand.rb +++ b/test/ruby/test_rand.rb @@ -415,4 +415,11 @@ END assert_equal(r1, r2) } end + + def test_marshal + bug3656 = '[ruby-core:31622]' + assert_raise(TypeError, bug3656) { + Random.new.marshal_load(0) + } + end end diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb index 02d8bd61ed..2f33ec2039 100644 --- a/test/ruby/test_rational.rb +++ b/test/ruby/test_rational.rb @@ -797,6 +797,11 @@ class Rational_Test < Test::Unit::TestCase assert_raise(ZeroDivisionError){ Marshal.load("\x04\bU:\rRational[\ai\x06i\x05") } + + bug3656 = '[ruby-core:31622]' + assert_raise(TypeError, bug3656) { + Rational(1,2).marshal_load(0) + } end def test_parse |