]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
7zip reader tests: fixes when LZMA is unsupported
authorMartin Matuska <martin@matuska.org>
Wed, 22 Jan 2020 14:28:08 +0000 (15:28 +0100)
committerMartin Matuska <martin@matuska.org>
Wed, 22 Jan 2020 14:28:08 +0000 (15:28 +0100)
libarchive/test/test_read_format_7zip.c
libarchive/test/test_read_format_7zip_packinfo_digests.c

index 7eb9d3c44eef8258e7e7184beb9d7acd603cb9b6..a51bdf7b6f651f8788db339e8c29c21aca5896d6 100644 (file)
@@ -720,7 +720,9 @@ DEFINE_TEST(test_read_format_7zip)
 
        /* Extracting with liblzma */
        if (ARCHIVE_OK != archive_read_support_filter_xz(a)) {
-               skipping("7zip:lzma decoding is not supported on this platform");
+               assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+               skipping("7zip:lzma decoding is not supported on this "
+                   "platform");
        } else {
                test_symname();
                test_extract_all_files("test_read_format_7zip_copy_2.7z");
@@ -795,7 +797,9 @@ DEFINE_TEST(test_read_format_7zip_lzma1)
 
        /* Extracting with liblzma */
        if (ARCHIVE_OK != archive_read_support_filter_xz(a)) {
-               skipping("7zip:lzma decoding is not supported on this platform");
+               assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+               skipping("7zip:lzma decoding is not supported on this "
+                   "platform");
        } else {
                test_plain_header("test_read_format_7zip_lzma1.7z");
                test_extract_all_files("test_read_format_7zip_lzma1_2.7z");
@@ -816,7 +820,9 @@ DEFINE_TEST(test_read_format_7zip_lzma2)
 
        /* Extracting with liblzma */
        if (ARCHIVE_OK != archive_read_support_filter_xz(a)) {
-               skipping("7zip:lzma decoding is not supported on this platform");
+               assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+               skipping("7zip:lzma decoding is not supported on this "
+                   "platform");
        } else {
                test_plain_header("test_read_format_7zip_lzma2.7z");
                test_bcj("test_read_format_7zip_bcj_lzma2.7z");
index 94cd1ad32e421764b47e8a0c753b66a4483b308a..3abee709643e9bbebfe360ad18866898785b2aa4 100644 (file)
@@ -35,6 +35,11 @@ DEFINE_TEST(test_read_format_7zip_packinfo_digests)
 
        extract_reference_file(refname);
        assert((a = archive_read_new()) != NULL);
+       if (ARCHIVE_OK != archive_read_support_filter_xz(a)) {
+               assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+               skipping("7zip:lzma decoding is not supported on this "
+               "platform");
+       }
        assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
        assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
        assertEqualIntA(a, ARCHIVE_OK,