summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Muramatsu <btmura@google.com>2010-09-30 14:50:54 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-09-30 14:50:54 -0700
commit9cc0b47e4b0f2ea33e3961e8b6d3cf041dbd0146 (patch)
tree48c83de19243b11f84c01767675f4163852bd644
parent2bcf15aac8c4dd82ef1a4b8defad00743569f927 (diff)
parente3d827e992cfecb4841d1218a0916f53ff403926 (diff)
downloadlibcore-9cc0b47e4b0f2ea33e3961e8b6d3cf041dbd0146.zip
libcore-9cc0b47e4b0f2ea33e3961e8b6d3cf041dbd0146.tar.gz
libcore-9cc0b47e4b0f2ea33e3961e8b6d3cf041dbd0146.tar.bz2
Merge "Add More Support_Locale Conditions to ScannerTest" into gingerbread
-rw-r--r--luni/src/test/java/tests/api/java/util/ScannerTest.java52
1 files changed, 28 insertions, 24 deletions
diff --git a/luni/src/test/java/tests/api/java/util/ScannerTest.java b/luni/src/test/java/tests/api/java/util/ScannerTest.java
index bafa7af..5587a42 100644
--- a/luni/src/test/java/tests/api/java/util/ScannerTest.java
+++ b/luni/src/test/java/tests/api/java/util/ScannerTest.java
@@ -1276,18 +1276,20 @@ public class ScannerTest extends TestCase {
* recognized by scanner with locale ar_AE, (123) shouble be recognized
* by scanner with locale mk_MK. But this is not the case on RI.
*/
- s = new Scanner("-123 123- -123-");
- s.useLocale(new Locale("ar", "AE"));
- assertEquals(-123, s.nextInt(10));
- // The following test case fails on RI
- if (!disableRIBugs) {
- assertEquals(-123, s.nextInt(10));
- }
- try {
- s.nextInt(10);
- fail("Should throw InputMismatchException");
- } catch (InputMismatchException e) {
- // expected
+ if (Support_Locale.areLocalesAvailable(new Locale[] {new Locale("ar", "AE")})) {
+ s = new Scanner("-123 123- -123-");
+ s.useLocale(new Locale("ar", "AE"));
+ assertEquals(-123, s.nextInt(10));
+ // The following test case fails on RI
+ if (!disableRIBugs) {
+ assertEquals(-123, s.nextInt(10));
+ }
+ try {
+ s.nextInt(10);
+ fail("Should throw InputMismatchException");
+ } catch (InputMismatchException e) {
+ // expected
+ }
}
// locale dependent test, bug 1943269
@@ -1504,18 +1506,20 @@ public class ScannerTest extends TestCase {
* recognized by scanner with locale ar_AE, (123) shouble be recognized
* by scanner with locale mk_MK. But this is not the case on RI.
*/
- s = new Scanner("-123 123- -123-");
- s.useLocale(new Locale("ar", "AE"));
- assertEquals(-123, s.nextInt());
- // The following test case fails on RI
- if (!disableRIBugs) {
- assertEquals(-123, s.nextInt());
- }
- try {
- s.nextInt();
- fail("Should throw InputMismatchException");
- } catch (InputMismatchException e) {
- // expected
+ if (Support_Locale.areLocalesAvailable(new Locale[] {new Locale("ar", "AE")})) {
+ s = new Scanner("-123 123- -123-");
+ s.useLocale(new Locale("ar", "AE"));
+ assertEquals(-123, s.nextInt());
+ // The following test case fails on RI
+ if (!disableRIBugs) {
+ assertEquals(-123, s.nextInt());
+ }
+ try {
+ s.nextInt();
+ fail("Should throw InputMismatchException");
+ } catch (InputMismatchException e) {
+ // expected
+ }
}
// locale dependent test, bug 1943269