diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-27 01:30:16 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-27 01:30:16 +0000 |
commit | 15ae462d8b1e87bc84395766a60e30d13349206b (patch) | |
tree | 4871f3b3f8760700a341400fdba957948a0f7b39 /test/digest | |
parent | 851c2f2daba8bcaf86bfc4d8b9fdc0ad812c1a40 (diff) |
digest.c: typed data
* ext/digest/digest.c (rb_digest_base_alloc): use typed data.
* ext/digest/digest.c (rb_digest_base_copy): fail unless original
object has same algorithm.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/digest')
-rwxr-xr-x | test/digest/test_digest.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/digest/test_digest.rb b/test/digest/test_digest.rb index cf541a4626..6c0da46fac 100755 --- a/test/digest/test_digest.rb +++ b/test/digest/test_digest.rb @@ -198,4 +198,16 @@ module TestDigest assert_raise(NotImplementedError, bug3810) {Digest::Base.new} end end + + class TestInitCopy < Test::Unit::TestCase + if defined?(Digest::MD5) and defined?(Digest::RMD160) + def test_initialize_copy_md5_rmd160 + assert_separately(%w[-rdigest], <<-'end;') + md5 = Digest::MD5.allocate + rmd160 = Digest::RMD160.allocate + assert_raise(TypeError) {md5.__send__(:initialize_copy, rmd160)} + end; + end + end + end end |