From: Michihiro NAKAJIMA Date: Sun, 7 Oct 2012 06:52:33 +0000 (+0900) Subject: Rename test_compat_lrzip to test_read_filter_lrzip since lrzip reader X-Git-Tag: v3.1.0~40^2~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5dd4141b1ee3715b46882da2322581f5f74f958f;p=thirdparty%2Flibarchive.git Rename test_compat_lrzip to test_read_filter_lrzip since lrzip reader entirely uses an external program, lrzip(1). It is not a compatible test. --- diff --git a/Makefile.am b/Makefile.am index ba4e7f4af..c2fda5954 100644 --- a/Makefile.am +++ b/Makefile.am @@ -303,7 +303,6 @@ libarchive_test_SOURCES= \ libarchive/test/test_compat_cpio.c \ libarchive/test/test_compat_gtar.c \ libarchive/test/test_compat_gzip.c \ - libarchive/test/test_compat_lrzip.c \ libarchive/test/test_compat_lzip.c \ libarchive/test/test_compat_lzma.c \ libarchive/test/test_compat_mac.c \ @@ -335,6 +334,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_read_filter_program.c \ libarchive/test/test_read_filter_program_signature.c \ libarchive/test/test_read_filter_uudecode.c \ + libarchive/test/test_read_filter_lrzip.c \ libarchive/test/test_read_filter_lzop.c \ libarchive/test/test_read_format_7zip.c \ libarchive/test/test_read_format_ar.c \ diff --git a/libarchive/test/CMakeLists.txt b/libarchive/test/CMakeLists.txt index 3de15e2b2..7f113558f 100644 --- a/libarchive/test/CMakeLists.txt +++ b/libarchive/test/CMakeLists.txt @@ -46,7 +46,6 @@ IF(ENABLE_TEST) test_compat_cpio.c test_compat_gtar.c test_compat_gzip.c - test_compat_lrzip.c test_compat_lzip.c test_compat_lzma.c test_compat_mac.c @@ -78,6 +77,7 @@ IF(ENABLE_TEST) test_read_filter_program.c test_read_filter_program_signature.c test_read_filter_uudecode.c + test_read_filter_lrzip.c test_read_filter_lzop.c test_read_format_7zip.c test_read_format_ar.c diff --git a/libarchive/test/test_compat_lrzip.c b/libarchive/test/test_read_filter_lrzip.c similarity index 87% rename from libarchive/test/test_compat_lrzip.c rename to libarchive/test/test_read_filter_lrzip.c index 12f71e50a..2f96fe930 100644 --- a/libarchive/test/test_compat_lrzip.c +++ b/libarchive/test/test_read_filter_lrzip.c @@ -24,15 +24,20 @@ */ #include "test.h" -static void -verify(const char *name) +DEFINE_TEST(test_read_filter_lrzip) { + const char *name = "test_compat_lrzip.tar.lrz"; /* lrzip tracks directories as files, ensure that we list everything */ - const char *n[] = { "d1/", "d1/f1", "d1/f2", "d1/f3", "f1", "f2", "f3", NULL }; + const char *n[] = { + "d1/", "d1/f1", "d1/f2", "d1/f3", "f1", "f2", "f3", NULL }; struct archive_entry *ae; struct archive *a; int i, r; + if (!canLrzip()) { + skipping("lrzip command-line program not found"); + } + assert((a = archive_read_new()) != NULL); r = archive_read_support_filter_lrzip(a); if (r == ARCHIVE_WARN) { @@ -43,12 +48,14 @@ verify(const char *name) assertEqualIntA(a, ARCHIVE_OK, r); assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); extract_reference_file(name); - assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 200)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, name, 200)); /* Read entries, match up names with list above. */ for (i = 0; i < 7; ++i) { failure("Could not read file %d (%s) from %s", i, n[i], name); - assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); if (r != ARCHIVE_OK) { archive_read_free(a); return; @@ -67,15 +74,3 @@ verify(const char *name) assertEqualInt(ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } - - -DEFINE_TEST(test_compat_lrzip) -{ - if (canLrzip()) { - verify("test_compat_lrzip.tar.lrz"); - } else { - skipping("lrzip command-line program not found"); - } -} - -