]> granicus.if.org Git - icu/commitdiff
ICU-20016 Skip testing pseudolocale region codes for display names.
authorFredrik Roubert <roubert@google.com>
Tue, 10 Jul 2018 19:09:47 +0000 (21:09 +0200)
committerShane Carr <shane@unicode.org>
Thu, 27 Sep 2018 21:27:37 +0000 (14:27 -0700)
At the moment, CLDR pseudolocale region codes don't have display names.
As long as that is so, ICU must not require them to exist in order to
not cause bogus test failures when building with pseudolocales.

icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUResourceBundleTest.java

index 28f77b7dc8ea81dba33a899d07f003187571aaa2..ebf536b1232355b8adaa2caab5f0b953b8dac319 100644 (file)
@@ -718,7 +718,13 @@ public final class ICUResourceBundleTest extends TestFmwk {
         }
 
         for (int i = 0; i < locales.length; ++i) {
-            if (!hasLocalizedCountryFor(ULocale.ENGLISH, locales[i])){
+            // The region codes used for pseudolocales don't have display names.
+            // That might however change in the future, in which case skipping
+            // testing of these names here would become irrelevant:
+            // https://unicode.org/cldr/trac/ticket/10880
+            String country = locales[i].getCountry();
+            if (!"XA".equals(country) && !"XB".equals(country)
+                    && !hasLocalizedCountryFor(ULocale.ENGLISH, locales[i])){
                  errln("Could not get English localized country for " + locales[i]);
             }
             if(!hasLocalizedLanguageFor(ULocale.ENGLISH, locales[i])){