]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix test failure without zlib.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sat, 15 Dec 2012 23:19:09 +0000 (08:19 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sat, 15 Dec 2012 23:19:09 +0000 (08:19 +0900)
libarchive/test/test_archive_write_add_filter_by_name.c
libarchive/test/test_read_set_format.c

index d1473363d5403ac43e26dbeac7df737123f9892f..ff5ca5b1d4713a5d04ea00f0e806aa676ce43853 100644 (file)
@@ -54,6 +54,15 @@ test_filter_by_name(const char *filter_name, int filter_code,
                        free(buff);
                        return;
                }
+       } else if (r == ARCHIVE_FATAL &&
+           (strcmp(archive_error_string(a),
+                  "lzma compression not supported on this platform") == 0 ||
+            strcmp(archive_error_string(a),
+                  "xz compression not supported on this platform") == 0)) {
+               skipping("%s filter not suported on this platform", filter_name);
+               assertEqualInt(ARCHIVE_OK, archive_write_free(a));
+               free(buff);
+               return;
        } else {
                if (!assertEqualIntA(a, ARCHIVE_OK, r)) {
                        assertEqualInt(ARCHIVE_OK, archive_write_free(a));
index 2b3ec1bdcbf2567f49d5619dd67b989bf18b7013..c218c42936d0b00e189d88987fabc21250183e66 100644 (file)
@@ -133,7 +133,7 @@ DEFINE_TEST(test_read_append_filter)
   assert((a = archive_read_new()) != NULL);
   assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR));
   r = archive_read_append_filter(a, ARCHIVE_FILTER_GZIP);
-  if (r == ARCHIVE_WARN) {
+  if (r == ARCHIVE_WARN && !canGzip()) {
     skipping("gzip reading not fully supported on this platform");
     assertEqualInt(ARCHIVE_OK, archive_read_free(a));
     return;