]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Remove test_compat_pax_libarchive_2x
authorMartin Matuska <martin@matuska.org>
Wed, 30 Jan 2019 16:43:50 +0000 (17:43 +0100)
committerMartin Matuska <martin@matuska.org>
Wed, 30 Jan 2019 16:43:50 +0000 (17:43 +0100)
The is determined for FreeBSD only and it doesn't work since 2015.
There is no significant need to keep this functionality, it may be
deprecated.

Makefile.am
libarchive/test/CMakeLists.txt
libarchive/test/test_compat_pax_libarchive_2x.c [deleted file]
libarchive/test/test_compat_pax_libarchive_2x.tar.Z.uu [deleted file]

index 9646e50ac9a8d05a47da4a152c085cf6a660961f..0e8056be1aca592e125f7af2f42bbd542757d4a8 100644 (file)
@@ -402,7 +402,6 @@ libarchive_test_SOURCES= \
        libarchive/test/test_compat_lzma.c \
        libarchive/test/test_compat_lzop.c \
        libarchive/test/test_compat_mac.c \
-       libarchive/test/test_compat_pax_libarchive_2x.c \
        libarchive/test/test_compat_perl_archive_tar.c \
        libarchive/test/test_compat_plexus_archiver_tar.c \
        libarchive/test/test_compat_solaris_tar_acl.c \
@@ -673,7 +672,6 @@ libarchive_test_EXTRA_DIST=\
        libarchive/test/test_compat_lzop_3.tar.lzo.uu \
        libarchive/test/test_compat_mac-1.tar.Z.uu \
        libarchive/test/test_compat_mac-2.tar.Z.uu \
-       libarchive/test/test_compat_pax_libarchive_2x.tar.Z.uu \
        libarchive/test/test_compat_perl_archive_tar.tar.uu \
        libarchive/test/test_compat_plexus_archiver_tar.tar.uu \
        libarchive/test/test_compat_solaris_pax_sparse_1.pax.Z.uu \
index 3927748576c6a56e44d96e67240cebae702f876b..690a83c5cd60c2d20bd0ce8b8cad8ed412051d79 100644 (file)
@@ -58,7 +58,6 @@ IF(ENABLE_TEST)
     test_compat_lzma.c
     test_compat_lzop.c
     test_compat_mac.c
-    test_compat_pax_libarchive_2x.c
     test_compat_perl_archive_tar.c
     test_compat_plexus_archiver_tar.c
     test_compat_solaris_pax_sparse.c
diff --git a/libarchive/test/test_compat_pax_libarchive_2x.c b/libarchive/test/test_compat_pax_libarchive_2x.c
deleted file mode 100644 (file)
index c7165f3..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*-
- * Copyright (c) 2011 Michihiro NAKAJIMA
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "test.h"
-__FBSDID("$FreeBSD");
-
-#include <locale.h>
-
-/*
- * Test "tar:compat-2x" option that enables the string conversion of
- * libarchive 2.x, which made incorrect UTF-8 form filenames for the
- * pax format on some platform the wchar_t of which was not Unicode form.
- * The option is unneeded if people have been using UTF-8 locale during
- * making tar files(in pax format).
- *
- * NOTE: The sample tar file was made with bsdtar 2.x in LANG=KOI8-R on
- * FreeBSD.
- */
-
-DEFINE_TEST(test_compat_pax_libarchive_2x)
-{
-#if (defined(_WIN32) && !defined(__CYGWIN__)) \
-         || defined(__STDC_ISO_10646__) || defined(__APPLE__)
-       skipping("This test only for the platform the WCS of which is "
-           "not Unicode.");
-#elif defined(__FreeBSD__)
-       skipping("This test is broken on newer FreeBSD versions");
-#else
-       struct archive *a;
-       struct archive_entry *ae;
-       char c;
-       wchar_t wc;
-       const char *refname = "test_compat_pax_libarchive_2x.tar.Z";
-
-       /*
-       * Read incorrect format UTF-8 filename in ru_RU.KOI8-R with
-       * "tar:compat-2x" option. We should correctly
-       * read two filenames.
-       */
-       if (NULL == setlocale(LC_ALL, "ru_RU.KOI8-R")) {
-               skipping("ru_RU.KOI8-R locale not available on this system.");
-               return;
-       }
-
-       /*
-        * Test if wchar_t format is the same as FreeBSD wchar_t.
-        */
-       assert(-1 != wctomb(NULL, L'\0'));
-       wc = (wchar_t)0xd0;
-       c = 0;
-       if (wctomb(&c, wc) != 1 || (unsigned char)c != 0xd0) {
-               skipping("wchar_t format is different on this platform.");
-               return;
-       }
-
-       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_set_options(a, "tar:compat-2x"));
-       assertEqualIntA(a, ARCHIVE_OK,
-           archive_read_open_filename(a, refname, 10240));
-
-       /* Verify regular first file. */
-       assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
-       assertEqualString("\xd0\xd2\xc9\xd7\xc5\xd4",
-           archive_entry_pathname(ae));
-       assertEqualInt(6, archive_entry_size(ae));
-
-       /* Verify regular second file. */
-       assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
-       assertEqualString("\xf0\xf2\xe9\xf7\xe5\xf4",
-           archive_entry_pathname(ae));
-       assertEqualInt(6, archive_entry_size(ae));
-
-
-       /* End of archive. */
-       assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
-
-       /* Verify archive format. */
-       assertEqualIntA(a, ARCHIVE_FILTER_COMPRESS, archive_filter_code(a, 0));
-       assertEqualIntA(a, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE,
-           archive_format(a));
-
-       /* Close the archive. */
-       assertEqualInt(ARCHIVE_OK, archive_read_close(a));
-       assertEqualInt(ARCHIVE_OK, archive_read_free(a));
-
-       /*
-        * Without "tar:compat-2x" option.
-        * Neither first file name nor second file name can be translated
-        * to KOI8-R.
-        */
-       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));
-
-       /* We cannot correctly read the filename. */
-       // This test used to look for WARN here coming from a
-       // character-conversion failure.  But: Newer iconv tables are
-       // more tolerant so we can't always detect the conversion
-       // failures.
-       assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
-       assert(strcmp("\xd0\xd2\xc9\xd7\xc5\xd4",
-           archive_entry_pathname(ae)) != 0);
-       assertEqualInt(6, archive_entry_size(ae));
-
-       /* We cannot correctly read the filename. */
-       // Same here:  The test is still valid (it sill verifies that
-       // the converted pathname is different), but we can no longer
-       // rely on WARN here.
-       assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
-       assert(strcmp("\xf0\xf2\xe9\xf7\xe5\xf4",
-           archive_entry_pathname(ae)) != 0);
-       assertEqualInt(6, archive_entry_size(ae));
-
-
-       /* End of archive. */
-       assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
-
-       /* Verify archive format. */
-       assertEqualIntA(a, ARCHIVE_FILTER_COMPRESS, archive_filter_code(a, 0));
-       assertEqualIntA(a, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE,
-           archive_format(a));
-
-       /* Close the archive. */
-       assertEqualInt(ARCHIVE_OK, archive_read_close(a));
-       assertEqualInt(ARCHIVE_OK, archive_read_free(a));
-#endif
-}
diff --git a/libarchive/test/test_compat_pax_libarchive_2x.tar.Z.uu b/libarchive/test/test_compat_pax_libarchive_2x.tar.Z.uu
deleted file mode 100644 (file)
index f440541..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-begin 644 test_compat_pax_libarchive_2x.tar.Z
-M'YV04,+@05(F#)DR<EY`DY;L6C%J`")*G$BQHL6+&#-JW%@1AL<;-6J``.`Q
-M!L@8(TN>3.FQ94D;-D#$B%&#QHT9,CS.B`DCADT;-P"`P,.QJ-&C2)-:K#.'
-M3A@Y)&&,J5-&:<:I5:U>=.F1I<N16L.*'4NV;%D9*.&$H8.FQS!(PR0-2S3L
-MTK!"PR@IR`EB#)TT;<KTB#$#!EJ0.&+@V`L#Q%K`@@D;QG$C!PX9.128!#%E
-M")(D3+*X.&BG1XX:>V5P]@Q:=!HW;P87IE'C!@W-.%9_#NW"#9O7:P8K,$N\
-MN/'CR),K7\Z\N?.)"QL^?$[=:$N0(J.:K(%2^\JH7%O&G%GS9DX8.T'T+`PC
-MJ/KJ\)$R=0K5(];B]XF']]H2;/S_`"H'CSSIW%,./0$FJ.""##;HX(,01@A`
-M0`,5=%!"`Q9XH(3Z?1022]MUIQ)W_+D4`TPRT6033CKQ1),,0`E%%(?PS?=4
-M5/F9E6-9^X'7'XU`-H@6"&JQY18LP\@R3"K#W#),*</0PEA??P4FFV';);88
-M7X]9*9D,E%F&F68WZ-;::&64=EIJ9O+V6FR2T082;FV*YAMPP@6IYYY\]NFG
-M4AD:B."?9EWWH7<D(BIB>.*E6!Z+Z+DX0V'NP4!H<C;6)Q55^'':X5<^=G7I
->J,<%NB&IJ*:JZJJLMNKJJ[#&*NNLM-9JZZVXYDH<
-`
-end