From: Bruno Haible Date: Thu, 15 Jun 2023 15:00:56 +0000 (+0200) Subject: Make internationalization tests stricter on Solaris 11 systems. X-Git-Tag: v0.22~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8557b78c15980f99bb8987b21f7507d061d7e571;p=thirdparty%2Fgettext.git Make internationalization tests stricter on Solaris 11 systems. * gettext-tools/tests/format-c-5-prg.c (main): Don't expect an Arabic digit output in a locale other than Farsi. * gettext-tools/tests/format-c-5: Try an Arabic locale as well. --- diff --git a/gettext-tools/tests/format-c-5 b/gettext-tools/tests/format-c-5 index d0cba225c..2f70335e9 100755 --- a/gettext-tools/tests/format-c-5 +++ b/gettext-tools/tests/format-c-5 @@ -80,11 +80,33 @@ else *) Exit 1;; esac + # Some systems (e.g. Solaris 11) don't have a Farsi locale. + # Therefore try an Arabic locale as well. + test -d ar || mkdir ar + test -d ar/LC_MESSAGES || mkdir ar/LC_MESSAGES + cp fa/LC_MESSAGES/fc5.mo ar/LC_MESSAGES/fc5.mo + + prepare_locale_ ar ar_EG + LANGUAGE= ../fc5 ar_EG + case $? in + 0) skipped=false ;; + 77) ;; + *) Exit 1;; + esac + + prepare_locale_ ar ar_EG.UTF-8 + LANGUAGE= ../fc5 ar_EG.UTF-8 + case $? in + 0) skipped=false ;; + 77) ;; + *) Exit 1;; + esac + if $skipped; then if test -f /usr/bin/localedef; then - echo "Skipping test: no Farsi locale is installed" + echo "Skipping test: no Farsi or Arabic locale is installed" else - echo "Skipping test: no Farsi locale is supported" + echo "Skipping test: no Farsi or Arabic locale is supported" fi Exit 77 fi diff --git a/gettext-tools/tests/format-c-5-prg.c b/gettext-tools/tests/format-c-5-prg.c index eacbbf91a..01e5c99c5 100644 --- a/gettext-tools/tests/format-c-5-prg.c +++ b/gettext-tools/tests/format-c-5-prg.c @@ -66,7 +66,10 @@ main (int argc, char *argv[]) en = "father of %d children"; #if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__ expected_translation = "Vater von %Id Kindern"; - expected_result = "Vater von \xdb\xb5 Kindern"; + if (strncmp (argv[1], "fa", 2) == 0) + expected_result = "Vater von \xdb\xb5 Kindern"; + else + expected_result = "Vater von 5 Kindern"; #else expected_translation = "Vater von %d Kindern"; expected_result = "Vater von 5 Kindern";