summaryrefslogtreecommitdiffstats
path: root/support/src/test
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-07-24 09:18:44 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-07-24 09:18:44 -0700
commitcd059a55c169e556d1fcfca145caa10173ae2174 (patch)
treedd38f8dfc705b0b4310770db940cedf29143b73b /support/src/test
parent18c6ef53b56aa0ae9ff225bf7567375e7448923c (diff)
parentbe240e1324314cbf1d8edaee7ce561b028e1ed2e (diff)
downloadlibcore-cd059a55c169e556d1fcfca145caa10173ae2174.zip
libcore-cd059a55c169e556d1fcfca145caa10173ae2174.tar.gz
libcore-cd059a55c169e556d1fcfca145caa10173ae2174.tar.bz2
am be240e13: Merge "Remove the isLocaleAvailable hacks."
* commit 'be240e1324314cbf1d8edaee7ce561b028e1ed2e': Remove the isLocaleAvailable hacks.
Diffstat (limited to 'support/src/test')
-rw-r--r--support/src/test/java/tests/support/Support_DecimalFormat.java51
-rw-r--r--support/src/test/java/tests/support/Support_Locale.java33
2 files changed, 18 insertions, 66 deletions
diff --git a/support/src/test/java/tests/support/Support_DecimalFormat.java b/support/src/test/java/tests/support/Support_DecimalFormat.java
index 9baa4cc..89e226a 100644
--- a/support/src/test/java/tests/support/Support_DecimalFormat.java
+++ b/support/src/test/java/tests/support/Support_DecimalFormat.java
@@ -139,37 +139,26 @@ public class Support_DecimalFormat extends Support_Format {
Locale us = Locale.US;
Locale tr = new Locale("de", "CH");
- if (Support_Locale.isLocaleAvailable(us)) {
- // locale dependent test, bug 1943269
+ // test number instance
+ t_Format(1, number, NumberFormat.getNumberInstance(us), getNumberVectorUS());
- // test number instance
- t_Format(1, number, NumberFormat.getNumberInstance(us),
- getNumberVectorUS());
+ // test integer instance
+ t_Format(2, number, NumberFormat.getIntegerInstance(us), getIntegerVectorUS());
- // test integer instance
- t_Format(2, number, NumberFormat.getIntegerInstance(us),
- getIntegerVectorUS());
+ // test percent instance
+ t_Format(3, number, NumberFormat.getPercentInstance(us), getPercentVectorUS());
- // test percent instance
- t_Format(3, number, NumberFormat.getPercentInstance(us),
- getPercentVectorUS());
+ // test currency instance with US Locale
+ t_Format(4, number, NumberFormat.getCurrencyInstance(us), getPositiveCurrencyVectorUS());
- // test currency instance with US Locale
- t_Format(4, number, NumberFormat.getCurrencyInstance(us),
- getPositiveCurrencyVectorUS());
+ // test negative currency instance with US Locale
+ t_Format(5, negativeNumber, NumberFormat.getCurrencyInstance(us), getNegativeCurrencyVectorUS());
- // test negative currency instance with US Locale
- t_Format(5, negativeNumber, NumberFormat.getCurrencyInstance(us),
- getNegativeCurrencyVectorUS());
+ // test multiple grouping separators
+ t_Format(6, longNumber, NumberFormat.getNumberInstance(us), getNumberVector2US());
- // test multiple grouping seperators
- t_Format(6, longNumber, NumberFormat.getNumberInstance(us),
- getNumberVector2US());
-
- // test 0
- t_Format(7, zeroNumber, NumberFormat.getNumberInstance(us),
- getZeroVector());
- }
+ // test 0
+ t_Format(7, zeroNumber, NumberFormat.getNumberInstance(us), getZeroVector());
// test permille pattern
DecimalFormat format = new DecimalFormat("###0.##\u2030");
@@ -183,15 +172,11 @@ public class Support_DecimalFormat extends Support_Format {
format = new DecimalFormat("0000.0#E0");
t_Format(10, number, format, getNegativeExponentVector());
- if (Support_Locale.isLocaleAvailable(tr)) {
- // test currency instance with TR Locale
- t_Format(11, number, NumberFormat.getCurrencyInstance(tr),
- getPositiveCurrencyVectorCH());
+ // test currency instance with TR Locale
+ t_Format(11, number, NumberFormat.getCurrencyInstance(tr), getPositiveCurrencyVectorCH());
- // test negative currency instance with TR Locale
- t_Format(12, negativeNumber, NumberFormat.getCurrencyInstance(tr),
- getNegativeCurrencyVectorCH());
- }
+ // test negative currency instance with TR Locale
+ t_Format(12, negativeNumber, NumberFormat.getCurrencyInstance(tr), getNegativeCurrencyVectorCH());
}
private static Vector<FieldContainer> getNumberVectorUS() {
diff --git a/support/src/test/java/tests/support/Support_Locale.java b/support/src/test/java/tests/support/Support_Locale.java
deleted file mode 100644
index 68f01c5..0000000
--- a/support/src/test/java/tests/support/Support_Locale.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.support;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Locale;
-import java.util.Set;
-
-/**
- * Helper class for tests that rely on locale data.
- */
-public class Support_Locale {
- public static boolean isLocaleAvailable(Locale requiredLocale) {
- Set<Locale> localeSet = new HashSet<Locale>(Arrays.asList(Locale.getAvailableLocales()));
- return localeSet.contains(requiredLocale);
- }
-}