10 # use Test::NoWarnings, if available
13 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
15 plan tests => 10612 + $extra ;
18 use_ok('Compress::Zlib', 2) ;
20 use_ok('IO::Compress::Gzip', qw($GzipError)) ;
21 use_ok('IO::Uncompress::Gunzip', qw($GunzipError)) ;
23 use_ok('IO::Compress::Deflate', qw($DeflateError)) ;
24 use_ok('IO::Uncompress::Inflate', qw($InflateError)) ;
26 use_ok('IO::Compress::RawDeflate', qw($RawDeflateError)) ;
27 use_ok('IO::Uncompress::RawInflate', qw($RawInflateError)) ;
34 some more stuff on this line
38 foreach my $CompressClass ('IO::Compress::Gzip',
39 'IO::Compress::Deflate',
40 'IO::Compress::RawDeflate',
43 my $UncompressClass = getInverse($CompressClass);
46 print "#\n# Testing $UncompressClass\n#\n";
52 if ($CompressClass eq 'IO::Compress::Gzip') {
53 ok( my $x = new IO::Compress::Gzip \$compressed,
55 -Comment => "this is a comment",
56 -ExtraField => [ 'ab' => "extra"],
58 ok $x->write($hello) ;
62 #hexDump($compressed) ;
64 ok($gz = new IO::Uncompress::Gunzip \$cc,
67 or print "$GunzipError\n";
69 ok $gz->read($un) > 0 ;
74 ok( my $x = new $CompressClass(\$compressed));
75 ok $x->write($hello) ;
79 ok($gz = new $UncompressClass(\$cc,
81 or print "$GunzipError\n";
83 ok $gz->read($un) > 0 ;
88 for my $blocksize (1,2,13)
90 for my $i (0 .. length($compressed) - 1)
92 for my $useBuf (0 .. 1)
94 print "#\n# BlockSize $blocksize, Length $i, Buffer $useBuf\n#\n" ;
95 my $name = "test.gz" ;
97 my $lex = new LexFile $name ;
99 my $prime = substr($compressed, 0, $i);
100 my $rest = substr($compressed, $i);
108 writeFile($name, $rest);
111 #my $gz = new $UncompressClass $name,
112 my $gz = new $UncompressClass $start,
114 -BlockSize => $blocksize,
122 $status = $gz->read($un) while $status > 0 ;
124 or print "status $status\n" ;
126 or print "Error is '" . $gz->error() . "'\n";
128 or print "# got [$un]\n";