]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix test failure without zlib.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 15 Feb 2012 20:37:10 +0000 (05:37 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 15 Feb 2012 20:49:59 +0000 (05:49 +0900)
libarchive/test/test_write_compress_program.c

index ba005a68fe4f331217b0d515e744d8c605a18711..4956e1a6fb6a88fe3ad99f4388c99625846c51a5 100644 (file)
@@ -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. */