summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-27 01:30:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-27 01:30:16 +0000
commit15ae462d8b1e87bc84395766a60e30d13349206b (patch)
tree4871f3b3f8760700a341400fdba957948a0f7b39 /test
parent851c2f2daba8bcaf86bfc4d8b9fdc0ad812c1a40 (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')
-rwxr-xr-xtest/digest/test_digest.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/digest/test_digest.rb b/test/digest/test_digest.rb
index cf541a4..6c0da46 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