From 899da565451620b340513fce804c09e85fe137c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <[email protected]>
Date: Fri, 10 Feb 2017 09:38:53 +0100
Subject: Adjust tests to zlib-1.2.11

---
 IO-Compress-2.070-Adapt-tests-to-zlib-1.2.11.patch | 95 ++++++++++++++++++++++
 perl-IO-Compress.spec                              |  9 +-
 2 files changed, 103 insertions(+), 1 deletion(-)
 create mode 100644 IO-Compress-2.070-Adapt-tests-to-zlib-1.2.11.patch

diff --git a/IO-Compress-2.070-Adapt-tests-to-zlib-1.2.11.patch 
b/IO-Compress-2.070-Adapt-tests-to-zlib-1.2.11.patch
new file mode 100644
index 0000000..91a35c8
--- /dev/null
+++ b/IO-Compress-2.070-Adapt-tests-to-zlib-1.2.11.patch
@@ -0,0 +1,95 @@
+From a30130055928e5979c35aceee75cc3becfe3ad22 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <[email protected]>
+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ř <[email protected]>
+---
+ 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
+
diff --git a/perl-IO-Compress.spec b/perl-IO-Compress.spec
index d4a9398..86716c6 100644
--- a/perl-IO-Compress.spec
+++ b/perl-IO-Compress.spec
@@ -3,12 +3,15 @@
 
 Name:           perl-IO-Compress
 Version:        2.070
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Read and write compressed data
 License:        GPL+ or Artistic
 Group:          Development/Libraries
 URL:            http://search.cpan.org/dist/IO-Compress/
 Source0:        
http://search.cpan.org/CPAN/authors/id/P/PM/PMQS/IO-Compress-%{version}.tar.gz
+# Adjust tests to zlib-1.2.11, bug #1420012, CPAN RT#120134, can be removed
+# after fixing perl-Compress-Raw-Zlib properly (CPAN RT#119762)
+Patch0:         IO-Compress-2.070-Adapt-tests-to-zlib-1.2.11.patch
 BuildArch:      noarch
 # Module Build
 BuildRequires:  coreutils
@@ -81,6 +84,7 @@ included with the IO-Compress distribution:
 
 %prep
 %setup -q -n IO-Compress-%{version}
+%patch0 -p1
 
 # Remove spurious exec permissions
 chmod -c -x lib/IO/Uncompress/{Adapter/Identity,RawInflate}.pm
@@ -131,6 +135,9 @@ make test 
COMPRESS_ZLIB_RUN_%{?with_long_tests:ALL}%{!?with_long_tests:MOST}=1
 %{_mandir}/man3/IO::Uncompress::*.3*
 
 %changelog
+* Fri Feb 10 2017 Petr Pisar <[email protected]> - 2.070-2
+- Adjust tests to zlib-1.2.11 (bug #1420012)
+
 * Thu Dec 29 2016 Paul Howarth <[email protected]> - 2.070-1
 - Update to 2.070
   - Fix prototype errors while lazy loading File::GlobMapper (CPAN RT#117675)
-- 
cgit v1.1


        
https://src.fedoraproject.org/cgit/perl-IO-Compress.git/commit/?h=master&id=899da565451620b340513fce804c09e85fe137c5
_______________________________________________
perl-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to