From: Martin Matuska Date: Wed, 22 Jan 2020 14:28:08 +0000 (+0100) Subject: 7zip reader tests: fixes when LZMA is unsupported X-Git-Tag: v3.4.2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f99d82d737a89039bcbc349fd9595a14b5ab6b37;p=thirdparty%2Flibarchive.git 7zip reader tests: fixes when LZMA is unsupported --- diff --git a/libarchive/test/test_read_format_7zip.c b/libarchive/test/test_read_format_7zip.c index 7eb9d3c44..a51bdf7b6 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 94cd1ad32..3abee7096 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,