]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Rename test_compat_lrzip to test_read_filter_lrzip since lrzip reader
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 7 Oct 2012 06:52:33 +0000 (15:52 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 7 Oct 2012 06:52:33 +0000 (15:52 +0900)
entirely uses an external program, lrzip(1). It is not a compatible test.

Makefile.am
libarchive/test/CMakeLists.txt
libarchive/test/test_read_filter_lrzip.c [moved from libarchive/test/test_compat_lrzip.c with 87% similarity]

index ba4e7f4afee054fc6c0d857a4b415f4124ee545b..c2fda595457f9d0c1acf2c9493983e60104c14fd 100644 (file)
@@ -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                   \
index 3de15e2b2f921104bb6f2410f7357cffc626d24b..7f113558ffde6e09b9dd14cd3ccba21af61dca68 100644 (file)
@@ -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
similarity index 87%
rename from libarchive/test/test_compat_lrzip.c
rename to libarchive/test/test_read_filter_lrzip.c
index 12f71e50a1face15d446b7e63d101fc52043056b..2f96fe930a0cca2e15be4162c1d6d5a46ea95f70 100644 (file)
  */
 #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");
-       }
-}
-
-