summaryrefslogtreecommitdiffstats
path: root/luni/src
diff options
context:
space:
mode:
authorpnath <pnath@sta.samsung.com>2012-02-03 18:52:04 -0800
committerBrian Muramatsu <btmura@google.com>2012-02-06 16:22:13 -0800
commit999187657af9408e86ae680be1f19f184512d210 (patch)
tree348f5a27c13895147e54a83a89f4d57efd8a1e9c /luni/src
parent990a68790304f9a87d4a07d5ba0e2b2fdba31f22 (diff)
downloadlibcore-999187657af9408e86ae680be1f19f184512d210.zip
libcore-999187657af9408e86ae680be1f19f184512d210.tar.gz
libcore-999187657af9408e86ae680be1f19f184512d210.tar.bz2
Fix for number pattern tests for devices not supporting "ar" locale
Test case should be skipped if "ar" locale is not supported. Change-Id: I40ec73ec785352d61fdf082f9b37ae054bffc993
Diffstat (limited to 'luni/src')
-rw-r--r--luni/src/test/java/libcore/java/text/NumberFormatTest.java7
-rw-r--r--luni/src/test/java/libcore/java/util/FormatterTest.java4
2 files changed, 11 insertions, 0 deletions
diff --git a/luni/src/test/java/libcore/java/text/NumberFormatTest.java b/luni/src/test/java/libcore/java/text/NumberFormatTest.java
index aeadf5f..c2621b4 100644
--- a/luni/src/test/java/libcore/java/text/NumberFormatTest.java
+++ b/luni/src/test/java/libcore/java/text/NumberFormatTest.java
@@ -23,6 +23,7 @@ import java.text.FieldPosition;
import java.text.NumberFormat;
import java.text.ParsePosition;
import java.util.Locale;
+import tests.support.Support_Locale;
public class NumberFormatTest extends junit.framework.TestCase {
// NumberFormat.format(Object, StringBuffer, FieldPosition) guarantees it calls doubleValue for
@@ -65,6 +66,9 @@ public class NumberFormatTest extends junit.framework.TestCase {
}
public void test_getIntegerInstance_ar() throws Exception {
+ if (!Support_Locale.isLocaleAvailable(new Locale("ar"))) {
+ return;
+ }
NumberFormat numberFormat = NumberFormat.getNumberInstance(new Locale("ar"));
assertEquals("#,##0.###;#,##0.###-", ((DecimalFormat) numberFormat).toPattern());
NumberFormat integerFormat = NumberFormat.getIntegerInstance(new Locale("ar"));
@@ -73,6 +77,9 @@ public class NumberFormatTest extends junit.framework.TestCase {
public void test_numberLocalization() throws Exception {
Locale arabic = new Locale("ar");
+ if (!Support_Locale.isLocaleAvailable(arabic)) {
+ return;
+ }
NumberFormat nf = NumberFormat.getNumberInstance(arabic);
assertEquals('\u0660', new DecimalFormatSymbols(arabic).getZeroDigit());
assertEquals("\u0661\u066c\u0662\u0663\u0664\u066c\u0665\u0666\u0667\u066c\u0668\u0669\u0660",
diff --git a/luni/src/test/java/libcore/java/util/FormatterTest.java b/luni/src/test/java/libcore/java/util/FormatterTest.java
index 00d0ab7..5c59807 100644
--- a/luni/src/test/java/libcore/java/util/FormatterTest.java
+++ b/luni/src/test/java/libcore/java/util/FormatterTest.java
@@ -20,10 +20,14 @@ import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Locale;
import java.util.TimeZone;
+import tests.support.Support_Locale;
public class FormatterTest extends junit.framework.TestCase {
public void test_numberLocalization() throws Exception {
Locale arabic = new Locale("ar");
+ if (!Support_Locale.isLocaleAvailable(arabic)) {
+ return;
+ }
// Check the fast path for %d:
assertEquals("12 \u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660 34",
String.format(arabic, "12 %d 34", 1234567890));