From: Paul Marquess Date: Fri, 29 Dec 2006 20:50:26 +0000 (+0000) Subject: Update Compress Modules to version 2.002 X-Git-Tag: accepted/trunk/20130322.191538~16264 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6fd7794b9baf00eb9b1d47e4ad481f2e8866e76;p=platform%2Fupstream%2Fperl.git Update Compress Modules to version 2.002 From: "Paul Marquess" Message-ID: <000501c72b8a$f96b2ba0$6401a8c0@myopwv.com> p4raw-id: //depot/perl@29641 --- diff --git a/ext/Compress/Raw/Zlib/Changes b/ext/Compress/Raw/Zlib/Changes index 8cc7638..10939b5 100644 --- a/ext/Compress/Raw/Zlib/Changes +++ b/ext/Compress/Raw/Zlib/Changes @@ -1,6 +1,10 @@ CHANGES ------- + 2.002 29 December 2006 + + * Documentation updates. + 2.001 1 November 2006 * Remove beta status. diff --git a/ext/Compress/Raw/Zlib/README b/ext/Compress/Raw/Zlib/README index 294900b..5d8ab3b 100644 --- a/ext/Compress/Raw/Zlib/README +++ b/ext/Compress/Raw/Zlib/README @@ -1,9 +1,9 @@ Compress::Raw::Zlib - Version 2.001 + Version 2.002 - 1st November 2006 + 29th December 2006 Copyright (c) 2005-2006 Paul Marquess. All rights reserved. diff --git a/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm b/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm index b160c6f..0cc4b11 100644 --- a/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm +++ b/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm @@ -13,7 +13,7 @@ use warnings ; use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD); -$VERSION = '2.001'; +$VERSION = '2.002'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; diff --git a/ext/Compress/Zlib/Changes b/ext/Compress/Zlib/Changes index fbdd180..4a21122 100644 --- a/ext/Compress/Zlib/Changes +++ b/ext/Compress/Zlib/Changes @@ -1,6 +1,15 @@ CHANGES ------- + 2.002 29 December 2006 + + * Documentation updates. + + * Fix append mode with gzopen. + rt-cpan.org 24041 + + * Allow gzopen to read from and write to a scalar reference. + 2.001 1 November 2006 * Remove beta status. diff --git a/ext/Compress/Zlib/README b/ext/Compress/Zlib/README index e5291ad..e0caaf9 100644 --- a/ext/Compress/Zlib/README +++ b/ext/Compress/Zlib/README @@ -1,9 +1,9 @@ Compress::Zlib - Version 2.001 + Version 2.002 - 1st November 2006 + 29th December 2006 Copyright (c) 1995-2006 Paul Marquess. All rights reserved. diff --git a/ext/Compress/Zlib/lib/Compress/Zlib.pm b/ext/Compress/Zlib/lib/Compress/Zlib.pm index de212ca..cb9508b 100644 --- a/ext/Compress/Zlib/lib/Compress/Zlib.pm +++ b/ext/Compress/Zlib/lib/Compress/Zlib.pm @@ -18,7 +18,7 @@ use warnings ; use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD); -$VERSION = '2.001'; +$VERSION = '2.002'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -120,12 +120,14 @@ sub gzopen($$) $defOpts{Level} = $1 if $mode =~ /(\d)/; $defOpts{Strategy} = Z_FILTERED() if $mode =~ /f/i; $defOpts{Strategy} = Z_HUFFMAN_ONLY() if $mode =~ /h/i; + $defOpts{Append} = 1 if $mode =~ /a/i; my $infDef = $writing ? 'deflate' : 'inflate'; my @params = () ; croak "gzopen: file parameter is not a filehandle or filename" - unless isaFilehandle $file || isaFilename $file ; + unless isaFilehandle $file || isaFilename $file || + (ref $file && ref $file eq 'SCALAR'); return undef unless $mode =~ /[rwa]/i ; @@ -141,6 +143,7 @@ sub gzopen($$) Transparent => 1, Append => 0, AutoClose => 1, + MultiStream => 1, Strict => 0) or $Compress::Zlib::gzerrno = $IO::Uncompress::Gunzip::GunzipError; } @@ -640,16 +643,19 @@ The C module can be split into two general areas of functionality, namely a simple read/write interface to I files and a low-level in-memory compression/decompression interface. -Each of these areas will be discussed separately below. +Each of these areas will be discussed in the following sections. =head2 Notes for users of Compress::Zlib version 1 -Version 2 of this module is a total rewrite. The net result of this is that -C does not now access the zlib library directly. +The main change in C version 2.x is that it does not now +interface directly to the zlib library. Instead it uses the +C and C modules for +reading/writing gzip files, and the C module for some +low-level zlib access. -It now uses the C and C modules -for reading/writing gzip files, and the C module for -low-level zlib access. +The interface provided by version 2 should be 100% backward compatible with +version 1. If you find a difference in the expected behaviour please +contact the author (See L). See L If you are writing new code, your first port of call should be to use one these new modules. @@ -660,7 +666,7 @@ A number of functions are supplied in I for reading and writing I files that conform to RFC 1952. This module provides an interface to most of them. -If you are upgrading from C 1.x, the following +If you have previously used C 1.x, the following enhancements/changes have been made to the C interface: =over 5 @@ -717,16 +723,19 @@ This function opens either the I file C<$filename> for reading or writing or attaches to the opened filehandle, C<$filehandle>. It returns an object on success and C on failure. -When writing a gzip file this interface will always create the smallest +When writing a gzip file this interface will I create the smallest possible gzip header (exactly 10 bytes). If you want greater control over -the information stored in the gzip header (like the original filename or a -comment) use L instead. +what gets stored in the gzip header (like the original filename or a +comment) use L instead. Similarly if +you want to read the contents of the gzip header use +L. The second parameter, C<$mode>, is used to specify whether the file is opened for reading or writing and to optionally specify a compression level and compression strategy when writing. The format of the C<$mode> parameter is similar to the mode parameter to the 'C' function C, -so "rb" is used to open for reading and "wb" for writing. +so "rb" is used to open for reading, "wb" for writing and "ab" for +appending (writing at the end of the file). To specify a compression level when writing, append a digit between 0 and 9 to the mode string -- 0 means no compression and 9 means maximum @@ -744,7 +753,6 @@ level 4 and run-length encoding. Refer to the I documentation for the exact format of the C<$mode> parameter. - =item B<$bytesread = $gz-Egzread($buffer [, $size]) ;> Reads C<$size> bytes from the compressed file into C<$buffer>. If diff --git a/ext/Compress/Zlib/t/03zlib-v1.t b/ext/Compress/Zlib/t/03zlib-v1.t index c98de63..0ad5440 100644 --- a/ext/Compress/Zlib/t/03zlib-v1.t +++ b/ext/Compress/Zlib/t/03zlib-v1.t @@ -23,10 +23,10 @@ BEGIN my $count = 0 ; if ($] < 5.005) { - $count = 353 ; + $count = 383 ; } else { - $count = 364 ; + $count = 394 ; } @@ -494,7 +494,7 @@ EOM { title "Check all bytes can be handled"; - my $lex = "\r\n" . new LexFile my $name ; + my $lex = new LexFile my $name ; my $data = join '', map { chr } 0x00 .. 0xFF; $data .= "\r\nabd\r\n"; @@ -801,10 +801,10 @@ EOM ok $@ =~ /^gzopen: file parameter is not a filehandle or filename at/ or print "# $@\n" ; - my $x = Symbol::gensym() ; - eval { gzopen($x, 0) ; } ; - ok $@ =~ /^gzopen: file parameter is not a filehandle or filename at/ - or print "# $@\n" ; +# my $x = Symbol::gensym() ; +# eval { gzopen($x, 0) ; } ; +# ok $@ =~ /^gzopen: file parameter is not a filehandle or filename at/ +# or print "# $@\n" ; } @@ -1090,5 +1090,74 @@ EOM } +sub slurp +{ + my $name = shift ; + + my $input; + my $fil = gzopen($name, "rb") ; + ok $fil , "opened $name"; + cmp_ok $fil->gzread($input, 50000), ">", 0, "read more than zero bytes"; + ok ! $fil->gzclose(), "closed ok"; + + return $input; +} + +sub trickle +{ + my $name = shift ; + + my $got; + my $input; + $fil = gzopen($name, "rb") ; + ok $fil, "opened ok"; + while ($fil->gzread($input, 50000) > 0) + { + $got .= $input; + $input = ''; + } + ok ! $fil->gzclose(), "closed ok"; + return $got; + return $input; +} + +{ + + title "Append & MultiStream Tests"; + # rt.24041 + + my $lex = new LexFile my $name ; + my $data1 = "the is the first"; + my $data2 = "and this is the second"; + my $trailing = "some trailing data"; + + my $fil; + + title "One file"; + $fil = gzopen($name, "wb") ; + ok $fil, "opened first file"; + is $fil->gzwrite($data1), length $data1, "write data1" ; + ok ! $fil->gzclose(), "Closed"; + + is slurp($name), $data1, "got expected data from slurp"; + is trickle($name), $data1, "got expected data from trickle"; + + title "Two files"; + $fil = gzopen($name, "ab") ; + ok $fil, "opened second file"; + is $fil->gzwrite($data2), length $data2, "write data2" ; + ok ! $fil->gzclose(), "Closed"; + + is slurp($name), $data1 . $data2, "got expected data from slurp"; + is trickle($name), $data1 . $data2, "got expected data from trickle"; + + title "Trailing Data"; + open F, ">>$name"; + print F $trailing; + close F; + + is slurp($name), $data1 . $data2 . $trailing, "got expected data from slurp" ; + is trickle($name), $data1 . $data2 . $trailing, "got expected data from trickle" ; +} diff --git a/ext/Compress/Zlib/t/14gzopen.t b/ext/Compress/Zlib/t/14gzopen.t index bade158..f8011e5 100644 --- a/ext/Compress/Zlib/t/14gzopen.t +++ b/ext/Compress/Zlib/t/14gzopen.t @@ -486,6 +486,9 @@ foreach my $stdio ( ['-', '-'], [*STDIN, *STDOUT]) SKIP: { my $lex = new LexFile my $name ; + skip "Cannot create non-readable file", 3 + if $^O eq 'cygwin'; + writeFile($name, "abc"); chmod 0222, $name ; diff --git a/ext/IO/Compress/Base/Changes b/ext/IO/Compress/Base/Changes index 0f022c5..e51c432 100644 --- a/ext/IO/Compress/Base/Changes +++ b/ext/IO/Compress/Base/Changes @@ -1,6 +1,17 @@ CHANGES ------- + 2.002 29 December 2006 + + * Documentation updates. + + * Added IO::Handle to the ISA test in isaFilehandle + + * Add an explicit use_ok test for Scalar::Util in the test harness. + The error message reported by 01misc implied the problem was + somewhere else. + Also explictly check that 'dualvar' is available. + 2.001 1 November 2006 * Remove beta status. diff --git a/ext/IO/Compress/Base/README b/ext/IO/Compress/Base/README index a290edd..07caefc 100644 --- a/ext/IO/Compress/Base/README +++ b/ext/IO/Compress/Base/README @@ -1,9 +1,9 @@ IO::Compress::Base - Version 2.001 + Version 2.002 - 1st November 2006 + 29th December 2006 Copyright (c) 2005-2006 Paul Marquess. All rights reserved. diff --git a/ext/IO/Compress/Base/lib/IO/Compress/Base.pm b/ext/IO/Compress/Base/lib/IO/Compress/Base.pm index 9b087b4..dc8a39a 100644 --- a/ext/IO/Compress/Base/lib/IO/Compress/Base.pm +++ b/ext/IO/Compress/Base/lib/IO/Compress/Base.pm @@ -20,7 +20,7 @@ use bytes; our (@ISA, $VERSION, $got_encode); #@ISA = qw(Exporter IO::File); -$VERSION = '2.001'; +$VERSION = '2.002'; #Can't locate object method "SWASHNEW" via package "utf8" (perhaps you forgot to load "utf8"?) at .../ext/Compress-Zlib/Gzip/blib/lib/Compress/Zlib/Common.pm line 16. @@ -565,7 +565,6 @@ sub DESTROY my $self = shift ; $self->close() ; - # TODO - memory leak with 5.8.0 - this isn't called until # global destruction # @@ -791,7 +790,7 @@ sub close # This delete can set $! in older Perls, so reset the errno $! = 0 ; } - + return 1; } diff --git a/ext/IO/Compress/Base/lib/IO/Compress/Base/Common.pm b/ext/IO/Compress/Base/lib/IO/Compress/Base/Common.pm index fe45202..3ccb19a 100644 --- a/ext/IO/Compress/Base/lib/IO/Compress/Base/Common.pm +++ b/ext/IO/Compress/Base/lib/IO/Compress/Base/Common.pm @@ -11,7 +11,7 @@ use File::GlobMapper; require Exporter; our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS); @ISA = qw(Exporter); -$VERSION = '2.001'; +$VERSION = '2.002'; @EXPORT = qw( isaFilehandle isaFilename whatIsInput whatIsOutput isaFileGlobString cleanFileGlobString oneTarget @@ -71,8 +71,10 @@ sub isaFilehandle($) { use utf8; # Pragma needed to keep Perl 5.6.0 happy return (defined $_[0] and - (UNIVERSAL::isa($_[0],'GLOB') or UNIVERSAL::isa(\$_[0],'GLOB')) - and defined fileno($_[0]) ) + (UNIVERSAL::isa($_[0],'GLOB') or + UNIVERSAL::isa($_[0],'IO::Handle') or + UNIVERSAL::isa(\$_[0],'GLOB')) + ) } sub isaFilename($) diff --git a/ext/IO/Compress/Base/lib/IO/Uncompress/AnyUncompress.pm b/ext/IO/Compress/Base/lib/IO/Uncompress/AnyUncompress.pm index 2e231ab..e9c1628 100644 --- a/ext/IO/Compress/Base/lib/IO/Uncompress/AnyUncompress.pm +++ b/ext/IO/Compress/Base/lib/IO/Uncompress/AnyUncompress.pm @@ -13,7 +13,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError); -$VERSION = '2.001'; +$VERSION = '2.002'; $AnyUncompressError = ''; @ISA = qw( Exporter IO::Uncompress::Base ); @@ -632,9 +632,13 @@ option. =item C<< Transparent => 0|1 >> -If this option is set and the input file or buffer is not compressed data, +If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. +In addition, if the input file/buffer does contain compressed data and +there is non-compressed data immediately following it, setting this option +will make this module treat the whole file/bufffer as a single data stream. + This option defaults to 1. =item C<< BlockSize => $num >> diff --git a/ext/IO/Compress/Base/lib/IO/Uncompress/Base.pm b/ext/IO/Compress/Base/lib/IO/Uncompress/Base.pm index 0442f41..cbf87f8 100644 --- a/ext/IO/Compress/Base/lib/IO/Uncompress/Base.pm +++ b/ext/IO/Compress/Base/lib/IO/Uncompress/Base.pm @@ -10,7 +10,7 @@ our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS); @ISA = qw(Exporter ); -$VERSION = '2.001'; +$VERSION = '2.002'; use constant G_EOF => 0 ; use constant G_ERR => -1 ; @@ -921,17 +921,28 @@ sub gotoNextStream *$self->{CompSize}->reset(); my $magic = $self->ckMagic(); + #*$self->{EndStream} = 0 ; if ( ! $magic) { - *$self->{EndStream} = 1 ; - return 0; - } + if (! *$self->{Transparent} ) + { + *$self->{EndStream} = 1 ; + return 0; + } - *$self->{Info} = $self->readHeader($magic); + $self->clearError(); + *$self->{Type} = 'plain'; + *$self->{Plain} = 1; + $self->pushBack(*$self->{HeaderPending}) ; + } + else + { + *$self->{Info} = $self->readHeader($magic); - if ( ! defined *$self->{Info} ) { - *$self->{EndStream} = 1 ; - return -1; + if ( ! defined *$self->{Info} ) { + *$self->{EndStream} = 1 ; + return -1; + } } push @{ *$self->{InfoList} }, *$self->{Info} ; @@ -1011,21 +1022,24 @@ sub read # Need to jump through more hoops - either length or offset # or both are specified. - my $out_buffer = \*$self->{Pending} ; + my $out_buffer = *$self->{Pending} ; - while (! *$self->{EndStream} && length($$out_buffer) < $length) + while (! *$self->{EndStream} && length($out_buffer) < $length) { - my $buf_len = $self->_raw_read($out_buffer); + my $buf_len = $self->_raw_read(\$out_buffer); return $buf_len if $buf_len < 0 ; } - $length = length $$out_buffer - if length($$out_buffer) < $length ; + $length = length $out_buffer + if length($out_buffer) < $length ; return 0 if $length == 0 ; + *$self->{Pending} = $out_buffer; + $out_buffer = \*$self->{Pending} ; + if ($offset) { $$buffer .= "\x00" x ($offset - length($$buffer)) if $offset > length($$buffer) ; diff --git a/ext/IO/Compress/Base/t/01misc.t b/ext/IO/Compress/Base/t/01misc.t index fd8cf66..59088c3 100644 --- a/ext/IO/Compress/Base/t/01misc.t +++ b/ext/IO/Compress/Base/t/01misc.t @@ -19,11 +19,18 @@ BEGIN { $extra = 1 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - plan tests => 76 + $extra ; + plan tests => 78 + $extra ; + use_ok('Scalar::Util'); use_ok('IO::Compress::Base::Common'); } + +ok gotScalarUtilXS(), "Got XS Version of Scalar::Util" + or diag < 0|1 >> -If this option is set and the input file or buffer is not compressed data, +If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. +In addition, if the input file/buffer does contain compressed data and +there is non-compressed data immediately following it, setting this option +will make this module treat the whole file/bufffer as a single data stream. + This option defaults to 1. =item C<< BlockSize => $num >> diff --git a/ext/IO/Compress/Zlib/lib/IO/Uncompress/Gunzip.pm b/ext/IO/Compress/Zlib/lib/IO/Uncompress/Gunzip.pm index d2f5da8..ae6d8bb 100644 --- a/ext/IO/Compress/Zlib/lib/IO/Uncompress/Gunzip.pm +++ b/ext/IO/Compress/Zlib/lib/IO/Uncompress/Gunzip.pm @@ -28,7 +28,7 @@ Exporter::export_ok_tags('all'); $GunzipError = ''; -$VERSION = '2.001'; +$VERSION = '2.002'; sub new { @@ -706,9 +706,13 @@ option. =item C<< Transparent => 0|1 >> -If this option is set and the input file or buffer is not compressed data, +If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. +In addition, if the input file/buffer does contain compressed data and +there is non-compressed data immediately following it, setting this option +will make this module treat the whole file/bufffer as a single data stream. + This option defaults to 1. =item C<< BlockSize => $num >> diff --git a/ext/IO/Compress/Zlib/lib/IO/Uncompress/Inflate.pm b/ext/IO/Compress/Zlib/lib/IO/Uncompress/Inflate.pm index b41f5f9..e482a08 100644 --- a/ext/IO/Compress/Zlib/lib/IO/Uncompress/Inflate.pm +++ b/ext/IO/Compress/Zlib/lib/IO/Uncompress/Inflate.pm @@ -13,7 +13,7 @@ use IO::Uncompress::RawInflate ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError); -$VERSION = '2.001'; +$VERSION = '2.002'; $InflateError = ''; @ISA = qw( Exporter IO::Uncompress::RawInflate ); @@ -627,9 +627,13 @@ option. =item C<< Transparent => 0|1 >> -If this option is set and the input file or buffer is not compressed data, +If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. +In addition, if the input file/buffer does contain compressed data and +there is non-compressed data immediately following it, setting this option +will make this module treat the whole file/bufffer as a single data stream. + This option defaults to 1. =item C<< BlockSize => $num >> diff --git a/ext/IO/Compress/Zlib/lib/IO/Uncompress/RawInflate.pm b/ext/IO/Compress/Zlib/lib/IO/Uncompress/RawInflate.pm index ec2aec3..456cd69 100644 --- a/ext/IO/Compress/Zlib/lib/IO/Uncompress/RawInflate.pm +++ b/ext/IO/Compress/Zlib/lib/IO/Uncompress/RawInflate.pm @@ -17,7 +17,7 @@ use IO::Uncompress::Adapter::Inflate ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError); -$VERSION = '2.001'; +$VERSION = '2.002'; $RawInflateError = ''; @ISA = qw( Exporter IO::Uncompress::Base ); @@ -735,8 +735,13 @@ This parameter defaults to 0. -This option is a no-op. +Allows multiple concatenated compressed streams to be treated as a single +compressed stream. Decompression will stop once either the end of the +file/buffer is reached, an error is encountered (premature eof, corrupt +compressed data) or the end of a stream is not immediately followed by the +start of another stream. +This parameter defaults to 0. =item C<< Prime => $string >> @@ -752,9 +757,13 @@ option. =item C<< Transparent => 0|1 >> -If this option is set and the input file or buffer is not compressed data, +If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. +In addition, if the input file/buffer does contain compressed data and +there is non-compressed data immediately following it, setting this option +will make this module treat the whole file/bufffer as a single data stream. + This option defaults to 1. =item C<< BlockSize => $num >> diff --git a/ext/IO/Compress/Zlib/lib/IO/Uncompress/Unzip.pm b/ext/IO/Compress/Zlib/lib/IO/Uncompress/Unzip.pm index c9ae61b..4aca7bb 100644 --- a/ext/IO/Compress/Zlib/lib/IO/Uncompress/Unzip.pm +++ b/ext/IO/Compress/Zlib/lib/IO/Uncompress/Unzip.pm @@ -27,7 +27,7 @@ require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError, %headerLookup); -$VERSION = '2.001'; +$VERSION = '2.002'; $UnzipError = ''; @ISA = qw(Exporter IO::Uncompress::RawInflate); @@ -1132,9 +1132,13 @@ option. =item C<< Transparent => 0|1 >> -If this option is set and the input file or buffer is not compressed data, +If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. +In addition, if the input file/buffer does contain compressed data and +there is non-compressed data immediately following it, setting this option +will make this module treat the whole file/bufffer as a single data stream. + This option defaults to 1. =item C<< BlockSize => $num >> diff --git a/t/lib/compress/CompTestUtils.pm b/t/lib/compress/CompTestUtils.pm index 85d53ba..1763b03 100644 --- a/t/lib/compress/CompTestUtils.pm +++ b/t/lib/compress/CompTestUtils.pm @@ -616,6 +616,13 @@ sub getMultiValues return (1,0); } + +sub gotScalarUtilXS +{ + eval ' use Scalar::Util "dualvar" '; + return $@ ? 0 : 1 ; +} + package CompTestUtils; 1; diff --git a/t/lib/compress/multi.pl b/t/lib/compress/multi.pl index 9daff1a..cfb5666 100644 --- a/t/lib/compress/multi.pl +++ b/t/lib/compress/multi.pl @@ -129,7 +129,7 @@ EOM ok $gz->close(), " close() ok" or diag "errno $!\n" ; - is $gz->streamCount(), $i +1, " streamCount ok" + is $gz->streamCount(), $i +1, " streamCount ok " . ($i +1) or diag "Stream count is " . $gz->streamCount(); ok $un eq join('', @buffs), " expected output" ; diff --git a/t/lib/compress/oneshot.pl b/t/lib/compress/oneshot.pl index ebfd042..6fdd4c9 100644 --- a/t/lib/compress/oneshot.pl +++ b/t/lib/compress/oneshot.pl @@ -95,14 +95,24 @@ sub run like $@, mkErr("^$TopType: input and output buffer are identical"), ' Input and Output buffer are the same'; - my $lex = new LexFile my $out_file ; - open OUT, ">$out_file" ; - eval { $a = $Func->(\*OUT, \*OUT) ;} ; - like $@, mkErr("^$TopType: input and output handle are identical"), - ' Input and Output handle are the same'; - - close OUT; - is -s $out_file, 0, " File zero length" ; + SKIP: + { + # Threaded 5.6.x seems to have a problem comparing filehandles. + use Config; + + skip 'Cannot compare filehandles with threaded $]', 2 + if $] >= 5.006 && $] < 5.007 && $Config{useithreads}; + + my $lex = new LexFile my $out_file ; + open OUT, ">$out_file" ; + eval { $a = $Func->(\*OUT, \*OUT) ;} ; + like $@, mkErr("^$TopType: input and output handle are identical"), + ' Input and Output handle are the same'; + + close OUT; + is -s $out_file, 0, " File zero length" ; + } + { my %x = () ; my $object = bless \%x, "someClass" ;