96 lines
2.6 KiB
Diff
96 lines
2.6 KiB
Diff
|
From a30130055928e5979c35aceee75cc3becfe3ad22 Mon Sep 17 00:00:00 2001
|
||
|
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||
|
Date: Tue, 7 Feb 2017 17:23:29 +0100
|
||
|
Subject: [PATCH] Adapt tests to zlib 1.2.11
|
||
|
MIME-Version: 1.0
|
||
|
Content-Type: text/plain; charset=UTF-8
|
||
|
Content-Transfer-Encoding: 8bit
|
||
|
|
||
|
CPAN RT#120134
|
||
|
|
||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||
|
---
|
||
|
t/cz-03zlib-v1.t | 13 +++++++++++--
|
||
|
t/cz-06gzsetp.t | 4 +++-
|
||
|
2 files changed, 14 insertions(+), 3 deletions(-)
|
||
|
|
||
|
diff --git a/t/cz-03zlib-v1.t b/t/cz-03zlib-v1.t
|
||
|
index a85ed10..e070d46 100755
|
||
|
--- a/t/cz-03zlib-v1.t
|
||
|
+++ b/t/cz-03zlib-v1.t
|
||
|
@@ -23,10 +23,10 @@ BEGIN
|
||
|
|
||
|
my $count = 0 ;
|
||
|
if ($] < 5.005) {
|
||
|
- $count = 453 ;
|
||
|
+ $count = 456 ;
|
||
|
}
|
||
|
else {
|
||
|
- $count = 471 ;
|
||
|
+ $count = 474 ;
|
||
|
}
|
||
|
|
||
|
|
||
|
@@ -721,6 +721,9 @@ EOM
|
||
|
|
||
|
($Answer, $status) = $x->deflate($hello) ;
|
||
|
ok $status == Z_OK ;
|
||
|
+ ($X, $status) = $x->flush(Z_BLOCK) ;
|
||
|
+ ok $status == Z_OK ;
|
||
|
+ $Answer .= $X ;
|
||
|
$input .= $hello;
|
||
|
|
||
|
# error cases
|
||
|
@@ -747,6 +750,9 @@ EOM
|
||
|
($X, $status) = $x->deflate($goodbye) ;
|
||
|
ok $status == Z_OK ;
|
||
|
$Answer .= $X ;
|
||
|
+ ($X, $status) = $x->flush(Z_BLOCK) ;
|
||
|
+ ok $status == Z_OK ;
|
||
|
+ $Answer .= $X ;
|
||
|
$input .= $goodbye;
|
||
|
|
||
|
# change only Level
|
||
|
@@ -759,6 +765,9 @@ EOM
|
||
|
($X, $status) = $x->deflate($goodbye) ;
|
||
|
ok $status == Z_OK ;
|
||
|
$Answer .= $X ;
|
||
|
+ ($X, $status) = $x->flush(Z_BLOCK) ;
|
||
|
+ ok $status == Z_OK ;
|
||
|
+ $Answer .= $X ;
|
||
|
$input .= $goodbye;
|
||
|
|
||
|
# change only Strategy
|
||
|
diff --git a/t/cz-06gzsetp.t b/t/cz-06gzsetp.t
|
||
|
index b2cc687..45869a0 100644
|
||
|
--- a/t/cz-06gzsetp.t
|
||
|
+++ b/t/cz-06gzsetp.t
|
||
|
@@ -39,7 +39,7 @@ my $ver = Compress::Zlib::zlib_version();
|
||
|
plan skip_all => "gzsetparams needs zlib 1.0.6 or better. You have $ver\n"
|
||
|
if ZLIB_VERNUM() < 0x1060 ;
|
||
|
|
||
|
-plan tests => 51 + $extra ;
|
||
|
+plan tests => 55 + $extra ;
|
||
|
|
||
|
# Check zlib_version and ZLIB_VERSION are the same.
|
||
|
SKIP: {
|
||
|
@@ -65,6 +65,7 @@ SKIP: {
|
||
|
|
||
|
$input .= $hello;
|
||
|
is $x->gzwrite($hello), $len_hello, "gzwrite returned $len_hello" ;
|
||
|
+ cmp_ok $x->gzflush(Z_BLOCK), '==', Z_OK, "flush before gzsetparams is ok";
|
||
|
|
||
|
# Error cases
|
||
|
eval { $x->gzsetparams() };
|
||
|
@@ -120,6 +121,7 @@ foreach my $CompressClass ('IO::Compress::Gzip',
|
||
|
|
||
|
my $input .= $hello;
|
||
|
is $x->write($hello), $len_hello, "wrote $len_hello bytes" ;
|
||
|
+ ok $x->flush(Z_BLOCK), "flush before deflateParams is ok";
|
||
|
|
||
|
# Change both Level & Strategy
|
||
|
ok $x->deflateParams(Z_BEST_SPEED, Z_HUFFMAN_ONLY), "deflateParams ok";
|
||
|
--
|
||
|
2.7.4
|
||
|
|