summaryrefslogtreecommitdiff
path: root/ext/Compress
diff options
context:
space:
mode:
authorPaul Marquess <paul.marquess@btinternet.com>2005-10-11 13:35:22 +0100
committerH.Merijn Brand <h.m.brand@xs4all.nl>2005-10-11 11:25:46 +0000
commit7043dac286be2ce0ee23303b16692db73651f3ae (patch)
tree12d90fe23d86c508e57c8f535eb270f92ad65c25 /ext/Compress
parent9c8463ea7c848a6cca2d9db2623308369ba11aca (diff)
downloadperl-7043dac286be2ce0ee23303b16692db73651f3ae.tar.gz
Compress::Zlib
From: "Paul Marquess" <Paul.Marquess@ntlworld.com> Message-ID: <013e01c5ce57$dee62af0$671c140a@myopwv.com> p4raw-id: //depot/perl@25735
Diffstat (limited to 'ext/Compress')
-rw-r--r--ext/Compress/Zlib/lib/Compress/Zlib/Common.pm1
-rw-r--r--ext/Compress/Zlib/t/16oneshot.t42
2 files changed, 16 insertions, 27 deletions
diff --git a/ext/Compress/Zlib/lib/Compress/Zlib/Common.pm b/ext/Compress/Zlib/lib/Compress/Zlib/Common.pm
index 1106105a35..443d9b37bb 100644
--- a/ext/Compress/Zlib/lib/Compress/Zlib/Common.pm
+++ b/ext/Compress/Zlib/lib/Compress/Zlib/Common.pm
@@ -27,6 +27,7 @@ sub setBinModeInput($)
{
my $handle = shift ;
+ binmode $handle ;
#binmode $handle if $] == 5.008 ;
#binmode $handle unless isSTDIN($handle) ;
}
diff --git a/ext/Compress/Zlib/t/16oneshot.t b/ext/Compress/Zlib/t/16oneshot.t
index 3310111598..7c24fba690 100644
--- a/ext/Compress/Zlib/t/16oneshot.t
+++ b/ext/Compress/Zlib/t/16oneshot.t
@@ -23,18 +23,18 @@ BEGIN {
$extra = 1
if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
- plan tests => 2526 + $extra ;
+ plan tests => 2462 + $extra ;
use_ok('Compress::Zlib', 2) ;
- use_ok('IO::Compress::Gzip', qw(gzip $GzipError)) ;
- use_ok('IO::Uncompress::Gunzip', qw(gunzip $GunzipError)) ;
+ use_ok('IO::Compress::Gzip', qw($GzipError)) ;
+ use_ok('IO::Uncompress::Gunzip', qw($GunzipError)) ;
- use_ok('IO::Compress::Deflate', qw(deflate $DeflateError)) ;
- use_ok('IO::Uncompress::Inflate', qw(inflate $InflateError)) ;
+ use_ok('IO::Compress::Deflate', qw($DeflateError)) ;
+ use_ok('IO::Uncompress::Inflate', qw($InflateError)) ;
- use_ok('IO::Compress::RawDeflate', qw(rawdeflate $RawDeflateError)) ;
- use_ok('IO::Uncompress::RawInflate', qw(rawinflate $RawInflateError)) ;
+ use_ok('IO::Compress::RawDeflate', qw($RawDeflateError)) ;
+ use_ok('IO::Uncompress::RawInflate', qw($RawInflateError)) ;
use_ok('IO::Uncompress::AnyInflate', qw(anyinflate $AnyInflateError)) ;
@@ -1064,7 +1064,7 @@ foreach my $bit ('IO::Uncompress::Gunzip',
my $lex = new LexFile($in_file) ;
writeFile($in_file, $comp);
- ok open(SAVEIN, "<&STDIN"), " save STDIN";
+ open(SAVEIN, "<&STDIN");
my $dummy = fileno SAVEIN ;
ok open(STDIN, "<$in_file"), " redirect STDIN";
@@ -1074,7 +1074,7 @@ foreach my $bit ('IO::Uncompress::Gunzip',
ok &$Func('-', \$output, Append => $append), ' Uncompressed ok'
or diag $$Error ;
- ok open(STDIN, "<&SAVEIN"), " put STDIN back";
+ open(STDIN, "<&SAVEIN");
is $keep_comp, $comp, " Input buffer not changed" ;
is $output, $expected, " Uncompressed matches original";
@@ -1117,14 +1117,13 @@ foreach my $bit ('IO::Uncompress::Gunzip',
{
title "$TopType - From stdin (via $stdin) to Buffer content, InputLength" ;
- my $in_file = "abcde.in";
- my $lex = new LexFile($in_file) ;
+ my $lex = new LexFile my $in_file ;
my $expected = $buffer ;
my $appended = 'appended';
my $len_appended = length $appended;
- writeFile($in_file, $comp . $appended . $comp . $appended) ;
+ writeFile($in_file, $comp . $appended ) ;
- ok open(SAVEIN, "<&STDIN"), " save STDIN";
+ open(SAVEIN, "<&STDIN");
my $dummy = fileno SAVEIN ;
ok open(STDIN, "<$in_file"), " redirect STDIN";
@@ -1139,18 +1138,7 @@ foreach my $bit ('IO::Uncompress::Gunzip',
is $output, $expected, " Uncompressed matches original";
is $buff, $appended, " Appended data ok";
- $output = '';
- ok &$Func($stdin, \$output, Transparent => 0, InputLength => length $comp), ' Uncompressed ok'
- or diag $$Error ;
-
- $buff = '';
- is read(STDIN, $buff, $len_appended), $len_appended, " Length of Appended data ok"
- or diag "read failed $!";
-
- is $output, $expected, " Uncompressed matches original";
- is $buff, $appended, " Appended data ok";
-
- ok open(STDIN, "<&SAVEIN"), " put STDIN back";
+ open(STDIN, "<&SAVEIN");
}
}
@@ -1387,8 +1375,8 @@ foreach my $TopType ('IO::Compress::Gzip::gzip',
my $got = anyUncompress(\$Answer);
is $got, $get, " got expected output" ;
- cmp_ok $$Error, '==', 0, " no error";
-
+ ok ! $$Error, " no error"
+ or diag "Error is $$Error";
}