summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-29 12:55:11 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-29 12:55:11 +0000
commita653ba0a4cb74dcf03d965f9b3308ff964758f42 (patch)
treeef00660a5d973958cd4da77aa06acce8defc54b6 /test
parent6588ba877a54e42a3f5d27b44d7ee500fd868243 (diff)
merge revision(s) 42720: [Backport #8829]
* ext/zlib/zlib.c (zstream_run): Fix handling of deflate streams that need a dictionary but are being decompressed by Zlib::Inflate.inflate (which has no option to set a dictionary). Now Zlib::NeedDict is raised instead of crashing. [ruby-trunk - Bug #8829] * test/zlib/test_zlib.rb (TestZlibInflate): Test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/zlib/test_zlib.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb
index 7b3ef2fc79..b4fe5abc30 100644
--- a/test/zlib/test_zlib.rb
+++ b/test/zlib/test_zlib.rb
@@ -232,6 +232,12 @@ if defined? Zlib
end
class TestZlibInflate < Test::Unit::TestCase
+ def test_class_inflate_dictionary
+ assert_raises(Zlib::NeedDict) do
+ Zlib::Inflate.inflate([0x08,0x3C,0x0,0x0,0x0,0x0].pack("c*"))
+ end
+ end
+
def test_initialize
assert_raise(Zlib::StreamError) { Zlib::Inflate.new(-1) }