]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix tests added in #2284 (#2387)
authorMartin Matuska <martin@matuska.de>
Wed, 23 Oct 2024 16:47:32 +0000 (18:47 +0200)
committerMartin Matuska <martin@matuska.de>
Wed, 23 Oct 2024 16:47:32 +0000 (18:47 +0200)
libarchive/test/test_write_format_zip_compression_bzip2.c
libarchive/test/test_write_format_zip_compression_lzmaxz.c
libarchive/test/test_write_format_zip_compression_zstd.c

index ebc2b740baaea4ce756287a0c9b4844f569c138d..2b93d24d3dd8661ecd4e20078750da402a5b4daa 100644 (file)
@@ -343,8 +343,12 @@ static void verify_bzip2_contents(const char *buff, size_t used)
        archive_read_free(zip_archive);
 }
 
+#endif /* HAVE_BZLIB_H */
 DEFINE_TEST(test_write_format_zip_compression_bzip2)
 {
+#ifndef HAVE_BZLIB_H
+       skipping("bzip2 is not fully supported on this platform");
+#else /* HAVE_BZLIB_H */
        /* Buffer data */
        struct archive *a;
        char buff[100000];
@@ -398,5 +402,5 @@ DEFINE_TEST(test_write_format_zip_compression_bzip2)
        dumpfile("constructed.zip", buff, used);
 
        verify_bzip2_contents(buff, used);
+#endif /* HAVE_BZLIB_H */
 }
-#endif
index 72b9faf1a6db82f8c057b059cf00a8f2e1c13ae0..efc65fdc3026b9def141c26d2ac7082d2633c64a 100644 (file)
@@ -328,8 +328,12 @@ static void verify_lzma_contents(const char *buff, size_t used)
        verify_xz_lzma(buff, used, 14, 0xA);
 }
 
+#endif /* HAVE_LZMA_H */
 DEFINE_TEST(test_write_format_zip_compression_lzmaxz)
 {
+#ifndef HAVE_LZMA_H
+       skipping("lzma is not fully supported on this platform");
+#else /* HAVE_LZMA_H */
        /* Buffer data */
        struct archive *a;
        char buff[100000];
@@ -434,5 +438,6 @@ DEFINE_TEST(test_write_format_zip_compression_lzmaxz)
        dumpfile("constructed.zip", buff, used);
 
        verify_xz_contents(buff, used);
+#endif /* HAVE_LZMA_H */
 }
-#endif
+
index 22c30ef248dcdda4dc293e571ccfe1b0351d5fc6..e846c388c72535e5be15874b8fac1b308b3d14e2 100644 (file)
@@ -343,8 +343,12 @@ static void verify_zstd_contents(const char *buff, size_t used)
        archive_read_free(zip_archive);
 }
 
+#endif /* HAVE_ZSTD_H */
 DEFINE_TEST(test_write_format_zip_compression_zstd)
 {
+#ifndef HAVE_ZSTD_H
+       skipping("zstd is not fully supported on this platform");
+#else /* HAVE_ZSTD_H */
        /* Buffer data */
        struct archive *a;
        char buff[100000];
@@ -401,5 +405,6 @@ DEFINE_TEST(test_write_format_zip_compression_zstd)
        dumpfile("constructed.zip", buff, used);
 
        verify_zstd_contents(buff, used);
+#endif /* HAVE_ZSTD_H */
 }
-#endif
+