summaryrefslogtreecommitdiffstats
path: root/benchmarks
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-29 17:41:25 -0700
committerNarayan Kamath <narayan@google.com>2014-06-16 11:47:41 +0100
commita94266074c7b82720fd2cecfb37ab8da85f1b296 (patch)
tree3a0b903bb2bbaaeb4fb8360deeb35eccabee2e9e /benchmarks
parentf577d7594f3acc1d97e119c508e8e4edfeb1f20b (diff)
downloadlibcore-a94266074c7b82720fd2cecfb37ab8da85f1b296.zip
libcore-a94266074c7b82720fd2cecfb37ab8da85f1b296.tar.gz
libcore-a94266074c7b82720fd2cecfb37ab8da85f1b296.tar.bz2
Pass BCP-47 tags and not Locale.toString results to ICU.
ICU can't handle the new toString forms for scripts etc. and it's also guaranteed to deal with BCP-47 tags correctly. Most of the changes in this patch are required to keep backwards compatibility for getDisplayCountry string etc. in the face of the transformations toLanguageTag performs. A few tests were changed, but for the better. The tagalog -> filipino charlie foxtrot will be dealt with in a follow up change. Co-Authored-By: Narayan Kamath <narayan@google.com> Change-Id: Ia7f26d92a0e38c4bbb1d839c0fbd8ad16a473bf5
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/src/benchmarks/regression/IcuBenchmark.java2
-rw-r--r--benchmarks/src/benchmarks/regression/StringCaseMappingBenchmark.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/benchmarks/src/benchmarks/regression/IcuBenchmark.java b/benchmarks/src/benchmarks/regression/IcuBenchmark.java
index ee8270a..2aed36b 100644
--- a/benchmarks/src/benchmarks/regression/IcuBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/IcuBenchmark.java
@@ -26,7 +26,7 @@ import libcore.icu.ICU;
public class IcuBenchmark extends SimpleBenchmark {
public void time_getBestDateTimePattern(int reps) throws Exception {
for (int rep = 0; rep < reps; ++rep) {
- ICU.getBestDateTimePattern("dEEEMMM", "US");
+ ICU.getBestDateTimePattern("dEEEMMM", new Locale("en", "US"));
}
}
}
diff --git a/benchmarks/src/benchmarks/regression/StringCaseMappingBenchmark.java b/benchmarks/src/benchmarks/regression/StringCaseMappingBenchmark.java
index cde257b..ae6b6b6 100644
--- a/benchmarks/src/benchmarks/regression/StringCaseMappingBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/StringCaseMappingBenchmark.java
@@ -106,13 +106,13 @@ public class StringCaseMappingBenchmark extends SimpleBenchmark {
public void timeToUpperCase_ICU(int reps) {
for (int i = 0; i < reps; ++i) {
- libcore.icu.ICU.toUpperCase(s.value, Locale.US.toString());
+ libcore.icu.ICU.toUpperCase(s.value, Locale.US);
}
}
public void timeToLowerCase_ICU(int reps) {
for (int i = 0; i < reps; ++i) {
- libcore.icu.ICU.toLowerCase(s.value, Locale.US.toString());
+ libcore.icu.ICU.toLowerCase(s.value, Locale.US);
}
}