public void TestDisplayName() { ULocale defLoc = IBM.ICU.Util.ULocale.GetDefault(); IBM.ICU.Util.ULocale.SetDefault(_DEFAULT_LOCALE); for (int i = 0; i < _LOCALE_NUMBER; i++) { ULocale oldLoc = _LOCALES[i][0]; ULocale newLoc = _LOCALES[i][1]; for (int j = 0; j < available.Length; j++) { String oldCountry = oldLoc.GetDisplayCountry(available[j]); String newCountry = newLoc.GetDisplayCountry(available[j]); String oldLang = oldLoc.GetDisplayLanguage(available[j]); String newLang = newLoc.GetDisplayLanguage(available[j]); // is there display name for the current country ID if (!newCountry.Equals(newLoc.GetCountry())) { if (!oldCountry.Equals(newCountry)) { Errln("getCountry() failed for " + oldLoc + " oldCountry= " + IBM.ICU.Charset.TestFmwk.Prettify(oldCountry) + " newCountry = " + IBM.ICU.Charset.TestFmwk.Prettify(newCountry) + " in display locale " + available[j].ToString()); } } // there is a display name for the current lang ID if (!newLang.Equals(newLoc.GetLanguage())) { if (!oldLang.Equals(newLang)) { Errln("getLanguage() failed for " + oldLoc + " oldLang = " + IBM.ICU.Charset.TestFmwk.Prettify(oldLang) + " newLang = " + IBM.ICU.Charset.TestFmwk.Prettify(newLang) + " in display locale " + available[j].ToString()); } } } } IBM.ICU.Util.ULocale.SetDefault(defLoc); }