From: Bruno Haible Date: Mon, 30 Jan 2012 19:32:33 +0000 (+0100) Subject: quotearg: Fix test failure on MacOS X 10.5. X-Git-Tag: v0.1~1194 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=98a2df60d039371416cee3e4a9e4a4abe98a30c9;p=gnulib.git quotearg: Fix test failure on MacOS X 10.5. * tests/test-quotearg-simple.c: Include localcharset.h. (main): If the locale encoding is not ASCII, bypass the tests of locale_quoting_style and clocale_quoting_style. * modules/quotearg-tests (Depends-on): Add 'localcharset'. --- diff --git a/ChangeLog b/ChangeLog index c6a99f556..27ef8845c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-01-29 Bruno Haible + + quotearg: Fix test failure on MacOS X 10.5. + * tests/test-quotearg-simple.c: Include localcharset.h. + (main): If the locale encoding is not ASCII, bypass the tests of + locale_quoting_style and clocale_quoting_style. + * modules/quotearg-tests (Depends-on): Add 'localcharset'. + 2012-01-29 Jim Meyering maint.mk: sc_prohibit_canonicalize_without_use: avoid false positive diff --git a/modules/quotearg-tests b/modules/quotearg-tests index 3c37428ba..1af4effd2 100644 --- a/modules/quotearg-tests +++ b/modules/quotearg-tests @@ -18,6 +18,7 @@ stdint setenv unsetenv setlocale +localcharset configure.ac: gt_LOCALE_FR diff --git a/tests/test-quotearg-simple.c b/tests/test-quotearg-simple.c index 3b3c36b82..e21ceb08f 100644 --- a/tests/test-quotearg-simple.c +++ b/tests/test-quotearg-simple.c @@ -27,6 +27,7 @@ #include #include +#include "localcharset.h" #include "progname.h" #include "macros.h" @@ -245,12 +246,20 @@ main (int argc _GL_UNUSED, char *argv[]) for (i = literal_quoting_style; i <= clocale_quoting_style; i++) { set_quoting_style (NULL, (enum quoting_style) i); - compare_strings (use_quotearg_buffer, &results_g[i].group1, ascii_only); - compare_strings (use_quotearg, &results_g[i].group2, ascii_only); - if (i == c_quoting_style) - compare_strings (use_quote_double_quotes, &results_g[i].group2, - ascii_only); - compare_strings (use_quotearg_colon, &results_g[i].group3, ascii_only); + if (!(i == locale_quoting_style || i == clocale_quoting_style) + || (strcmp (locale_charset (), "ASCII") == 0 + || strcmp (locale_charset (), "ANSI_X3.4-1968") == 0)) + { + compare_strings (use_quotearg_buffer, &results_g[i].group1, + ascii_only); + compare_strings (use_quotearg, &results_g[i].group2, + ascii_only); + if (i == c_quoting_style) + compare_strings (use_quote_double_quotes, &results_g[i].group2, + ascii_only); + compare_strings (use_quotearg_colon, &results_g[i].group3, + ascii_only); + } } set_quoting_style (NULL, literal_quoting_style);