From: Michihiro NAKAJIMA Date: Wed, 15 Feb 2012 20:37:10 +0000 (+0900) Subject: Fix test failure without zlib. X-Git-Tag: v3.0.4~2^2~86 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8d2058d226e4c1113ce2857f3adddb0ab24d596e;p=thirdparty%2Flibarchive.git Fix test failure without zlib. --- diff --git a/libarchive/test/test_write_compress_program.c b/libarchive/test/test_write_compress_program.c index ba005a68f..4956e1a6f 100644 --- a/libarchive/test/test_write_compress_program.c +++ b/libarchive/test/test_write_compress_program.c @@ -40,6 +40,15 @@ DEFINE_TEST(test_write_compress_program) skipping("Cannot run 'gzip'"); return; } + /* NOTE: Setting blocksize=1024 will cause gunzip failure because + * it add extra bytes that gunzip ignores with its warning and + * exit code 1. So we should set blocksize=1 in order not to + * yield the extra bytes when using gunzip. */ + assert((a = archive_read_new()) != NULL); + r = archive_read_support_filter_gzip(a); + if (r != ARCHIVE_OK && canGunzip()) + blocksize = 1; + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); /* Create a new archive in memory. */ /* Write it through an external "gzip" program. */