summaryrefslogtreecommitdiff
path: root/icu4j/main
diff options
context:
space:
mode:
authorJoachim Sauer <jsauer@google.com>2016-10-06 12:10:44 +0100
committerFredrik Roubert <roubert@google.com>2018-05-31 16:40:01 -0700
commit369ee6872c512dee42c1c9828eb0a8da3c80e015 (patch)
treebd7d646f5981670e59d4dc23864b9c963e0f2645 /icu4j/main
parent926c458b0803cea4a71e771db29648246b679565 (diff)
downloadicu-369ee6872c512dee42c1c9828eb0a8da3c80e015.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: I514d5c96a737eb8432ddaada0946d813d7a87d0f
Diffstat (limited to 'icu4j/main')
-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 6aaba7290..b2d73293e 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");
}
}