diff options
author | Martin Matuska <martin@matuska.org> | 2020-01-22 15:28:08 +0100 |
---|---|---|
committer | Martin Matuska <martin@matuska.org> | 2020-01-22 15:28:08 +0100 |
commit | f99d82d737a89039bcbc349fd9595a14b5ab6b37 (patch) | |
tree | c2a81d29fe450b64192c1934307288fdfe70c336 | |
parent | 5326ce61abfc8ce735ef4ad0ef714ba47e0e886e (diff) | |
download | libarchive-f99d82d737a89039bcbc349fd9595a14b5ab6b37.tar.gz |
7zip reader tests: fixes when LZMA is unsupported
-rw-r--r-- | libarchive/test/test_read_format_7zip.c | 12 | ||||
-rw-r--r-- | libarchive/test/test_read_format_7zip_packinfo_digests.c | 5 |
2 files changed, 14 insertions, 3 deletions
diff --git a/libarchive/test/test_read_format_7zip.c b/libarchive/test/test_read_format_7zip.c index 7eb9d3c4..a51bdf7b 100644 --- a/libarchive/test/test_read_format_7zip.c +++ b/libarchive/test/test_read_format_7zip.c @@ -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"); diff --git a/libarchive/test/test_read_format_7zip_packinfo_digests.c b/libarchive/test/test_read_format_7zip_packinfo_digests.c index 94cd1ad3..3abee709 100644 --- a/libarchive/test/test_read_format_7zip_packinfo_digests.c +++ b/libarchive/test/test_read_format_7zip_packinfo_digests.c @@ -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, |