]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
added missing checks for canLzip, canLzma, and canXz
authorjiat75 <jiat0218@gmail.com>
Sun, 3 Oct 2021 07:23:28 +0000 (15:23 +0800)
committerjiat75 <jiat0218@gmail.com>
Mon, 4 Oct 2021 13:55:18 +0000 (21:55 +0800)
libarchive/test/test_archive_write_add_filter_by_name.c
libarchive/test/test_read_truncated_filter.c
test_utils/test_main.c

index ba8c1d0472f6676a08f10e8e38656fae89fa1243..b91739841add009f958d4efa1b5c15dad4c51008 100644 (file)
@@ -185,12 +185,12 @@ DEFINE_TEST(test_archive_write_add_filter_by_name_lz4)
 
 DEFINE_TEST(test_archive_write_add_filter_by_name_lzip)
 {
-       test_filter_by_name("lzip", ARCHIVE_FILTER_LZIP, cannot);
+       test_filter_by_name("lzip", ARCHIVE_FILTER_LZIP, canLzip);
 }
 
 DEFINE_TEST(test_archive_write_add_filter_by_name_lzma)
 {
-       test_filter_by_name("lzma", ARCHIVE_FILTER_LZMA, cannot);
+       test_filter_by_name("lzma", ARCHIVE_FILTER_LZMA, canLzma);
 }
 
 DEFINE_TEST(test_archive_write_add_filter_by_name_lzop)
@@ -205,7 +205,7 @@ DEFINE_TEST(test_archive_write_add_filter_by_name_uuencode)
 
 DEFINE_TEST(test_archive_write_add_filter_by_name_xz)
 {
-       test_filter_by_name("xz", ARCHIVE_FILTER_XZ, cannot);
+       test_filter_by_name("xz", ARCHIVE_FILTER_XZ, canXz);
 }
 
 DEFINE_TEST(test_archive_write_add_filter_by_name_zstd)
index 632638d6fe9286ecd67ee8626343b380e7219a0e..4c409cc0004c8bfe88a7fb41167b6bba2013a859 100644 (file)
@@ -154,12 +154,12 @@ DEFINE_TEST(test_read_truncated_filter_gzip)
 
 DEFINE_TEST(test_read_truncated_filter_lzip)
 {
-       test_truncation("lzip", archive_write_add_filter_lzip, 0);
+       test_truncation("lzip", archive_write_add_filter_lzip, canLzip());
 }
 
 DEFINE_TEST(test_read_truncated_filter_lzma)
 {
-       test_truncation("lzma", archive_write_add_filter_lzma, 0);
+       test_truncation("lzma", archive_write_add_filter_lzma, canLzma());
 }
 
 DEFINE_TEST(test_read_truncated_filter_lzop)
@@ -169,5 +169,5 @@ DEFINE_TEST(test_read_truncated_filter_lzop)
 
 DEFINE_TEST(test_read_truncated_filter_xz)
 {
-       test_truncation("xz", archive_write_add_filter_xz, 0);
+       test_truncation("xz", archive_write_add_filter_xz, canXz());
 }
index c1c03cdafd7004b7dac79c95ef28d5f3598d5838..48ae2628413bfd18028513e9c858ae07ce71768a 100644 (file)
@@ -2610,7 +2610,7 @@ canLzma(void)
        static int tested = 0, value = 0;
        if (!tested) {
                tested = 1;
-               if (systemf("lzma %s", redirectArgs) == 0)
+               if (systemf("lzma --help %s", redirectArgs) == 0)
                        value = 1;
        }
        return (value);