aboutsummaryrefslogtreecommitdiffstats
path: root/test/zlib
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-19 00:06:04 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-19 00:06:04 +0000
commit439575890301d6649797002bc5e0739b1be25328 (patch)
tree94c96defdf0ffcc4fbf700b7e5f0cc5f439736b9 /test/zlib
parent77f3fc305491dab95b02d9d60c5f883f9e5b05df (diff)
downloadruby-439575890301d6649797002bc5e0739b1be25328.tar.gz
* ext/zlib/zlib.c: added Zlib.crc32_combine and Zlib.adler32_combine
* test/zlib/test_zlib.rb: corresponding tests [ruby-core:27551] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/zlib')
-rw-r--r--test/zlib/test_zlib.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb
index abb3ea32b3..6982db7a5f 100644
--- a/test/zlib/test_zlib.rb
+++ b/test/zlib/test_zlib.rb
@@ -662,6 +662,12 @@ if defined? Zlib
assert_equal(0x8a62c964, Zlib.adler32("abc\x01\x02\x03" * 10000))
end
+ def test_adler32_combine
+ one = Zlib.adler32("fo")
+ two = Zlib.adler32("o")
+ assert_equal(0x02820145, Zlib.adler32_combine(one, two, 1))
+ end
+
def test_crc32
assert_equal(0x00000000, Zlib.crc32)
assert_equal(0x8c736521, Zlib.crc32("foo"))
@@ -669,6 +675,12 @@ if defined? Zlib
assert_equal(0x07f0d68f, Zlib.crc32("abc\x01\x02\x03" * 10000))
end
+ def test_crc32_combine
+ one = Zlib.crc32("fo")
+ two = Zlib.crc32("o")
+ assert_equal(0x8c736521, Zlib.crc32_combine(one, two, 1))
+ end
+
def test_crc_table
t = Zlib.crc_table
assert_instance_of(Array, t)