aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/test/test_read_format_7zip_packinfo_digests.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/test/test_read_format_7zip_packinfo_digests.c')
-rw-r--r--libarchive/test/test_read_format_7zip_packinfo_digests.c76
1 files changed, 44 insertions, 32 deletions
diff --git a/libarchive/test/test_read_format_7zip_packinfo_digests.c b/libarchive/test/test_read_format_7zip_packinfo_digests.c
index 94cd1ad32e42..7f105d1f2806 100644
--- a/libarchive/test/test_read_format_7zip_packinfo_digests.c
+++ b/libarchive/test/test_read_format_7zip_packinfo_digests.c
@@ -35,43 +35,55 @@ DEFINE_TEST(test_read_format_7zip_packinfo_digests)
extract_reference_file(refname);
assert((a = archive_read_new()) != NULL);
- assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
- assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
- assertEqualIntA(a, ARCHIVE_OK,
- archive_read_open_filename(a, refname, 10240));
+ if (ARCHIVE_OK != archive_read_support_filter_xz(a)) {
+ skipping("7zip:lzma decoding is not supported on this "
+ "platform");
+ } else {
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_filter_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
- /* Verify regular file1. */
- assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
- assertEqualInt((AE_IFREG | 0666), archive_entry_mode(ae));
- assertEqualString("a.txt", archive_entry_pathname(ae));
- assertEqualInt(1576808819, archive_entry_mtime(ae));
- assertEqualInt(4, archive_entry_size(ae));
- assertEqualInt(archive_entry_is_encrypted(ae), 0);
- assertEqualIntA(a, archive_read_has_encrypted_entries(a), 0);
- assertEqualInt(4, archive_read_data(a, buff, sizeof(buff)));
- assertEqualMem(buff, "aaa\n", 4);
+ /* Verify regular file1. */
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae));
+ assertEqualInt((AE_IFREG | 0666), archive_entry_mode(ae));
+ assertEqualString("a.txt", archive_entry_pathname(ae));
+ assertEqualInt(1576808819, archive_entry_mtime(ae));
+ assertEqualInt(4, archive_entry_size(ae));
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), 0);
+ assertEqualInt(4, archive_read_data(a, buff, sizeof(buff)));
+ assertEqualMem(buff, "aaa\n", 4);
- /* Verify regular file2. */
- assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
- assertEqualInt((AE_IFREG | 0666), archive_entry_mode(ae));
- assertEqualString("b.txt", archive_entry_pathname(ae));
- assertEqualInt(1576808819, archive_entry_mtime(ae));
- assertEqualInt(4, archive_entry_size(ae));
- assertEqualInt(archive_entry_is_encrypted(ae), 0);
- assertEqualIntA(a, archive_read_has_encrypted_entries(a), 0);
- assertEqualInt(4, archive_read_data(a, buff, sizeof(buff)));
- assertEqualMem(buff, "bbb\n", 4);
+ /* Verify regular file2. */
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_next_header(a, &ae));
+ assertEqualInt((AE_IFREG | 0666), archive_entry_mode(ae));
+ assertEqualString("b.txt", archive_entry_pathname(ae));
+ assertEqualInt(1576808819, archive_entry_mtime(ae));
+ assertEqualInt(4, archive_entry_size(ae));
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), 0);
+ assertEqualInt(4, archive_read_data(a, buff, sizeof(buff)));
+ assertEqualMem(buff, "bbb\n", 4);
- assertEqualInt(2, archive_file_count(a));
+ assertEqualInt(2, archive_file_count(a));
- /* End of archive. */
- assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ /* End of archive. */
+ assertEqualIntA(a, ARCHIVE_EOF,
+ archive_read_next_header(a, &ae));
- /* Verify archive format. */
- assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0));
- assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a));
+ /* Verify archive format. */
+ assertEqualIntA(a, ARCHIVE_FILTER_NONE,
+ archive_filter_code(a, 0));
+ assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP,
+ archive_format(a));
- /* Close the archive. */
- assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ /* Close the archive. */
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ }
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}