NAME => 'Compress::Raw::Zlib',
VERSION_FROM => 'lib/Compress/Raw/Zlib.pm',
INC => "-I$ZLIB_INCLUDE" ,
- DEFINE => "-DNO_VIZ -DZ_SOLO $OLD_ZLIB $WALL -DGZIP_OS_CODE=$GZIP_OS_CODE $USE_PPPORT_H" ,
+ DEFINE => "-DNO_VIZ $OLD_ZLIB $WALL -DGZIP_OS_CODE=$GZIP_OS_CODE $USE_PPPORT_H" ,
XS => { 'Zlib.xs' => 'Zlib.c'},
'depend' => { 'Makefile' => 'config.in' },
'clean' => { FILES => '*.c constants.h constants.xs' },
use Test::More ;
use CompTestUtils;
+use constant ZLIB_1_2_12_0 => 0x12C0;
BEGIN
{
# print "x $status\n";
last if $status == Z_STREAM_END or $status != Z_OK ;
}
-
- cmp_ok $status, '==', Z_DATA_ERROR ;
- is $GOT, $goodbye ;
+ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib
+ if (ZLIB_VERNUM >= ZLIB_1_2_12_0)
+ {
+ cmp_ok $status, '==', Z_STREAM_END ;
+ }
+ else
+ {
+ cmp_ok $status, '==', Z_DATA_ERROR ;
+ }
+
+ is $GOT, $goodbye ;
# Check inflateSync leaves good data in buffer
my $rest = $Answer ;
is length($rest), $len2, "expected compressed output";
$GOT = '';
- cmp_ok $k->inflate($rest, $GOT), '==', Z_DATA_ERROR, "inflate returns Z_DATA_ERROR";
+ $status = $k->inflate($rest, $GOT);
+ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib
+ if (ZLIB_VERNUM >= ZLIB_1_2_12_0)
+ {
+ cmp_ok $status, '==', Z_STREAM_END ;
+ }
+ else
+ {
+ cmp_ok $status, '==', Z_DATA_ERROR ;
+ }
+
is $GOT, $goodbye ;
}