summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Sauer <jsauer@google.com>2016-10-06 12:10:44 +0100
committerFredrik Roubert <roubert@google.com>2017-11-30 16:01:40 +0100
commit3030701456759e5b9efaae44cf5b8c20f6b87415 (patch)
treeaba3ab0b1da68e82779092a3cd862000302f65a5
parent0aeb60382f4d54d6949e9c1f43694c5e80955fc1 (diff)
downloadicu-3030701456759e5b9efaae44cf5b8c20f6b87415.tar.gz
Android patch: Be more tolerant about last locale name.
ULocaleTest.TestGetAvailable expected the last available locale to be zu_ZA. This is correct with the data we ship. Adding additional locales after this locale would break the test (adding locales that alphabetically sort before that locale would not be counted as an error). Verify that the last locale starts with "z" to ensure we at least don't lose locales. This change was introduced in Android for the O release: https://android.googlesource.com/platform/external/icu/+/82d33ed (cherry picked from commit 244df5a9e49eb3e0457ee00034a9dfd960057574) Change-Id: I1726134cf389ca173f51b1ee27a768ca01b03fd9
-rw-r--r--icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java
index c0340ba01..78779a0c4 100644
--- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java
@@ -1006,7 +1006,11 @@ public class ULocaleTest extends TestFmwk {
if(locales.length<10){
errln("Did not get the correct result from getAvailableLocales");
}
- if(!locales[locales.length-1].getName().equals("zu_ZA")){
+ // Android patch (http://b/31841293) start.
+ // Accept locales other than zu_ZA at the end, as some OEMs add locales. Any locale added
+ // after the original zu_ZA has to start with "z", as that's the last acceptable letter.
+ if(!locales[locales.length-1].getName().startsWith("z")){
+ // Android patch (http://b/31841293) end.
errln("Did not get the expected result");
}
}