From: Tim Kientzle Date: Mon, 2 Nov 2009 04:39:11 +0000 (-0500) Subject: Rename LOCALE_DE to LOCALE_UTF8, since the code assumes it's a UTF8 locale. Set... X-Git-Tag: v2.8.0~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4a5515023ef3117af85fdcf984e76cc40f83a25;p=thirdparty%2Flibarchive.git Rename LOCALE_DE to LOCALE_UTF8, since the code assumes it's a UTF8 locale. Set it to NULL on Windows, change some of the tests to skip when this is NULL. This removes most of the assertion failures in test_entry. SVN-Revision: 1578 --- diff --git a/libarchive/test/test.h b/libarchive/test/test.h index f6d9fe772..87071c041 100644 --- a/libarchive/test/test.h +++ b/libarchive/test/test.h @@ -83,9 +83,9 @@ /* Windows (including Visual Studio and MinGW but not Cygwin) */ #if defined(_WIN32) && !defined(__CYGWIN__) #define strdup _strdup -#define LOCALE_DE "deu" +#define LOCALE_UTF8 NULL #else -#define LOCALE_DE "de_DE.UTF-8" +#define LOCALE_UTF8 "de_DE.UTF-8" #endif /* Visual Studio */ diff --git a/libarchive/test/test_entry.c b/libarchive/test/test_entry.c index af9ac984d..1caae8405 100644 --- a/libarchive/test/test_entry.c +++ b/libarchive/test/test_entry.c @@ -833,7 +833,7 @@ DEFINE_TEST(test_entry) /* * Exercise the character-conversion logic, if we can. */ - if (NULL == setlocale(LC_ALL, LOCALE_DE)) { + if (NULL == LOCALE_UTF8 || NULL == setlocale(LC_ALL, LOCALE_UTF8)) { skipping("Can't exercise charset-conversion logic without" " a suitable locale."); } else { diff --git a/libarchive/test/test_pax_filename_encoding.c b/libarchive/test/test_pax_filename_encoding.c index 700e6f436..dfa6ae91b 100644 --- a/libarchive/test/test_pax_filename_encoding.c +++ b/libarchive/test/test_pax_filename_encoding.c @@ -107,9 +107,10 @@ test_pax_filename_encoding_2(void) * de_DE.UTF-8 seems to be commonly supported. */ /* If it doesn't exist, just warn and return. */ - if (NULL == setlocale(LC_ALL, LOCALE_DE)) { + if (LOCALE_UTF8 == NULL + || NULL == setlocale(LC_ALL, LOCALE_UTF8)) { skipping("invalid encoding tests require a suitable locale;" - " %s not available on this system", LOCALE_DE); + " %s not available on this system", LOCALE_UTF8); return; }