summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Muramatsu <btmura@google.com>2010-08-25 15:08:44 -0700
committerBrian Muramatsu <btmura@google.com>2010-08-25 15:08:44 -0700
commite3d827e992cfecb4841d1218a0916f53ff403926 (patch)
treeab5603c2a507ef0e69ca683b5ace8657e066cf6c
parent7740fdf49bd3968f8a3f23b251db07291e2b0595 (diff)
downloadlibcore-e3d827e992cfecb4841d1218a0916f53ff403926.zip
libcore-e3d827e992cfecb4841d1218a0916f53ff403926.tar.gz
libcore-e3d827e992cfecb4841d1218a0916f53ff403926.tar.bz2
Add More Support_Locale Conditions to ScannerTest
Bug 2946181 Change-Id: Ib3bf57c9be2ab3b19b34ef90ffcb90da8a556117
-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