From: Bruno Haible Date: Sun, 13 Dec 2009 09:53:13 +0000 (+0100) Subject: Avoid a test failure on MacOS X 10.5. X-Git-Tag: v0.18~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=919588732611ebe71adbe19dbc8301751c138c7f;p=thirdparty%2Fgettext.git Avoid a test failure on MacOS X 10.5. --- diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index 16e613b63..50edabf6d 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,9 @@ +2009-12-13 Bruno Haible + + Avoid a test failure on MacOS X 10.5. + * lang-java: Make the test work when both locales fr_FR.ISO8859-1 and + fr_FR.UTF-8 exist. + 2009-12-12 Bruno Haible * *.c: Untabify. diff --git a/gettext-tools/tests/lang-java b/gettext-tools/tests/lang-java index f6cecb64e..da9cd0ee4 100755 --- a/gettext-tools/tests/lang-java +++ b/gettext-tools/tests/lang-java @@ -38,24 +38,13 @@ public class Program { Locale.setDefault(new Locale("fr","FR")); EOF case "$host_os" in - darwin[56]*) -cat <<\EOF >> Program.java - // Some systems (like MacOS X) don't set System.out's character encoding - // to ISO-8859-1, which is what we need for comparison purposes. - try { - System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out), - true, "ISO-8859-1")); - } catch (UnsupportedEncodingException e) { - } -EOF - ;; darwin*) cat <<\EOF >> Program.java // Some systems (like MacOS X) don't set System.out's character encoding - // to UTF-8, which is what we need for comparison purposes. + // according to LC_ALL, which is what we need for comparison purposes. try { System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out), - true, "UTF-8")); + true, args[1])); } catch (UnsupportedEncodingException e) { } EOF @@ -216,11 +205,11 @@ EOF : ${LOCALE_FR_UTF8=fr_FR.UTF-8} : ${JAVAEXEC="/bin/sh ../javaexec.sh"} if test $LOCALE_FR != none; then - LANGUAGE= LC_ALL=$LOCALE_FR CLASSPATH=.:../../gettext-runtime/intl-java/libintl.jar ${JAVAEXEC} Program 2 > prog.out || exit 1 + LANGUAGE= LC_ALL=$LOCALE_FR CLASSPATH=.:../../gettext-runtime/intl-java/libintl.jar ${JAVAEXEC} Program 2 ISO-8859-1 > prog.out || exit 1 ${DIFF} prog.ok prog.out || exit 1 fi if test $LOCALE_FR_UTF8 != none; then - LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 CLASSPATH=.:../../gettext-runtime/intl-java/libintl.jar ${JAVAEXEC} Program 2 > prog.out || exit 1 + LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 CLASSPATH=.:../../gettext-runtime/intl-java/libintl.jar ${JAVAEXEC} Program 2 UTF-8 > prog.out || exit 1 ${DIFF} prog.oku prog.out || exit 1 fi