summaryrefslogtreecommitdiff
path: root/libarchive
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive')
-rw-r--r--libarchive/test/CMakeLists.txt1
-rw-r--r--libarchive/test/test_read_format_zip.c34
-rw-r--r--libarchive/test/test_read_format_zip_7z_lzma.c31
3 files changed, 34 insertions, 32 deletions
diff --git a/libarchive/test/CMakeLists.txt b/libarchive/test/CMakeLists.txt
index efdeb809..4be5bf4c 100644
--- a/libarchive/test/CMakeLists.txt
+++ b/libarchive/test/CMakeLists.txt
@@ -170,7 +170,6 @@ IF(ENABLE_TEST)
test_read_format_xar.c
test_read_format_zip.c
test_read_format_zip_7075_utf8_paths.c
- test_read_format_zip_7z_lzma.c
test_read_format_zip_comment_stored.c
test_read_format_zip_encryption_data.c
test_read_format_zip_encryption_header.c
diff --git a/libarchive/test/test_read_format_zip.c b/libarchive/test/test_read_format_zip.c
index 04dfecb0..c547eb0c 100644
--- a/libarchive/test/test_read_format_zip.c
+++ b/libarchive/test/test_read_format_zip.c
@@ -966,3 +966,37 @@ DEFINE_TEST(test_read_format_zip_lzma_stream_end_blockread)
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
}
+
+DEFINE_TEST(test_read_format_zip_7z_lzma)
+{
+ const char *refname = "test_read_format_zip_7z_lzma.zip";
+ struct archive_entry *ae;
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+ if (ARCHIVE_OK != archive_read_support_filter_lzma(a)) {
+ skipping("lzma reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+ return;
+ }
+ extract_reference_file(refname);
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ while(1) {
+ int res = archive_read_next_header(a, &ae);
+ if (res == ARCHIVE_EOF)
+ break;
+
+ assertEqualInt(ARCHIVE_OK, res);
+ if (archive_entry_filetype(ae) == AE_IFLNK)
+ assertEqualString("../samples/abc_measurement_analysis_sample"
+ "/src/abc_measurement_analysis_sample.py",
+ archive_entry_symlink(ae));
+ }
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
+}
diff --git a/libarchive/test/test_read_format_zip_7z_lzma.c b/libarchive/test/test_read_format_zip_7z_lzma.c
deleted file mode 100644
index 9b7329bf..00000000
--- a/libarchive/test/test_read_format_zip_7z_lzma.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "test.h"
-__FBSDID("$FreeBSD$");
-
-DEFINE_TEST(test_read_format_zip_7z_lzma)
-{
- const char *refname = "test_read_format_zip_7z_lzma.zip";
- struct archive_entry *ae;
- struct archive *a;
-
- 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));
-
- while(1) {
- int res = archive_read_next_header(a, &ae);
- if (res == ARCHIVE_EOF)
- break;
-
- assertEqualInt(ARCHIVE_OK, res);
- if (archive_entry_filetype(ae) == AE_IFLNK)
- assertEqualString("../samples/abc_measurement_analysis_sample"
- "/src/abc_measurement_analysis_sample.py",
- archive_entry_symlink(ae));
- }
-
- assertEqualInt(ARCHIVE_OK, archive_read_close(a));
- assertEqualInt(ARCHIVE_OK, archive_read_free(a));
-}