From: Paul Marquess Date: Sat, 21 Mar 2009 13:31:59 +0000 (+0000) Subject: Fixes for ext/compress X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7efcbeefb3812bba5ff588d00b309f3591f5df08;p=p5sagit%2Fp5-mst-13.2.git Fixes for ext/compress --- diff --git a/ext/Compress-Raw-Zlib/Changes b/ext/Compress-Raw-Zlib/Changes index c66156c..02e68cc 100644 --- a/ext/Compress-Raw-Zlib/Changes +++ b/ext/Compress-Raw-Zlib/Changes @@ -4,7 +4,8 @@ CHANGES 2.017 1 February 2009 * Added 'LimitOutput' option - TODO - document it + + * Fixed coring issue when LimitOutput was used. * Documented Compress::Raw::Zlib::zlib_version() diff --git a/ext/Compress-Raw-Zlib/Zlib.xs b/ext/Compress-Raw-Zlib/Zlib.xs index 9a117f3..944e342 100644 --- a/ext/Compress-Raw-Zlib/Zlib.xs +++ b/ext/Compress-Raw-Zlib/Zlib.xs @@ -1338,7 +1338,7 @@ inflate (s, buf, output, eof=FALSE) while (RETVAL == Z_OK) { if (s->stream.avail_out == 0) { /* out of space in the output buffer so make it bigger */ - Sv_Grow(output, SvLEN(output) + bufinc) ; + Sv_Grow(output, SvLEN(output) + bufinc +1) ; cur_length += increment ; s->stream.next_out = (Bytef*) SvPVbyte_nolen(output) + cur_length ; increment = bufinc ; diff --git a/ext/IO-Compress/Changes b/ext/IO-Compress/Changes index 8e392c9..f422d5b 100644 --- a/ext/IO-Compress/Changes +++ b/ext/IO-Compress/Changes @@ -1,10 +1,13 @@ CHANGES ------- - 2.017 22 February 2009 + 2.017 30 March 2009 * TODO - mention LimitOutput + * A few chenges to get the test harness to work on VMS courtesy of + Craig. A. Berry. + * Merged IO-Compress-Base, IO-Compress-Bzip2, IO-Compress-Zlib & Compress-Zlib into IO-Compress. diff --git a/t/lib/compress/generic.pl b/t/lib/compress/generic.pl index f65b8d9..4e2f113 100644 --- a/t/lib/compress/generic.pl +++ b/t/lib/compress/generic.pl @@ -18,7 +18,7 @@ BEGIN $extra = 1 if $st ; - plan(tests => 675 + $extra) ; + plan(tests => 666 + $extra) ; } sub myGZreadFile @@ -57,15 +57,6 @@ sub run like $@, mkEvalErr("^$CompressClass: output buffer is read-only") ; my($out, $gz); - $out = "" ; - $a = new $CompressClass $out ; - is $!, "No such file or directory", '$! = "no such file or directory"'; - is $$Error, "cannot open file '': No such file or directory"; - - $out = undef ; - $a = new $CompressClass $out ; - is $!, "No such file or directory", '$! = "no such file or directory"'; - is $$Error, "cannot open file '': No such file or directory"; my $x ; $gz = new $CompressClass(\$x); @@ -78,7 +69,6 @@ sub run eval ' $gz->write({})' ; like $@, mkEvalErr("^${CompressClass}::write: not a scalar reference"); - #like $@, mkEvalErr("^${CompressClass}::write: input parameter not a filename, filehandle, array ref or scalar ref"); eval ' $gz->syswrite("abc", 1, 5)' ; like $@, mkEvalErr("^${CompressClass}::write: offset outside string"); @@ -92,22 +82,13 @@ sub run title "Testing $UncompressClass Errors"; my $out = "" ; - $a = new $UncompressClass $out ; - is $!, "No such file or directory", '$! = "no such file or directory"'; - is $$UnError, "cannot open file '': No such file or directory"; - - $out = undef ; - $a = new $UncompressClass $out ; - is $!, "No such file or directory", '$! = "no such file or directory"'; - is $$UnError, "cannot open file '': No such file or directory"; my $lex = new LexFile my $name ; ok ! -e $name, " $name does not exist"; eval qq[\$a = new $UncompressClass "$name" ;] ; - is $!, "No such file or directory", '$! = "no such file or directory"'; - is $$UnError, "cannot open file '$name': No such file or directory"; + is lc($!), "no such file or directory", '$! = "no such file or directory"'; my $gc ; my $guz = new $CompressClass(\$gc); diff --git a/t/lib/compress/merge.pl b/t/lib/compress/merge.pl index 7083b3b..477c3d3 100644 --- a/t/lib/compress/merge.pl +++ b/t/lib/compress/merge.pl @@ -91,7 +91,7 @@ sub run { if ($to_file) { - like $$Error, "/Permission denied/", + like lc($$Error), '/permission denied/', " Got non-writable filename message" ; } else {