aboutsummaryrefslogtreecommitdiff
path: root/test/sun/nio
diff options
context:
space:
mode:
authorsherman <none@none>2010-06-22 14:04:36 -0400
committersherman <none@none>2010-06-22 14:04:36 -0400
commit226f93191b80e6abbf8fbe21e23c0eb7d84b0130 (patch)
tree6377d308b9bce003766844345d3b56132e06e8c2 /test/sun/nio
parent005b672c17171b2e3d5763bc82eb4d91b752e724 (diff)
6963156: TEST_BUG: Several tests under sun/nio/cs failed
Summary: Updated the test cases and removed them from ProblemList.txt Reviewed-by: alanb
Diffstat (limited to 'test/sun/nio')
-rw-r--r--test/sun/nio/cs/FindDecoderBugs.java5
-rw-r--r--test/sun/nio/cs/TestX11CNS.java16
2 files changed, 17 insertions, 4 deletions
diff --git a/test/sun/nio/cs/FindDecoderBugs.java b/test/sun/nio/cs/FindDecoderBugs.java
index 2e52e6018..f0f9d258b 100644
--- a/test/sun/nio/cs/FindDecoderBugs.java
+++ b/test/sun/nio/cs/FindDecoderBugs.java
@@ -298,7 +298,7 @@ public class FindDecoderBugs {
void testRandomly(byte[] prefix, int n) {
int len = prefix.length;
byte[] ia = Arrays.copyOf(prefix, len + n);
- for (int i = 0; i < 10000; i++) {
+ for (int i = 0; i < 5000; i++) {
for (int j = 0; j < n; j++)
ia[len + j] = randomByte();
test(ia);
@@ -435,6 +435,9 @@ public class FindDecoderBugs {
static void equal(Object x, Object y) {
if (x == null ? y == null : x.equals(y)) pass();
else fail(x + " not equal to " + y);}
+ static void equal(int x, int y) {
+ if (x == y) pass();
+ else fail(x + " not equal to " + y);}
public static void main(String[] args) throws Throwable {
try {realMain(args);} catch (Throwable t) {unexpected(t);}
System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
diff --git a/test/sun/nio/cs/TestX11CNS.java b/test/sun/nio/cs/TestX11CNS.java
index 5ba3c8b39..9d276a8ef 100644
--- a/test/sun/nio/cs/TestX11CNS.java
+++ b/test/sun/nio/cs/TestX11CNS.java
@@ -94,6 +94,8 @@ public class TestX11CNS {
}
static void compare(Charset newCS, Charset oldCS) throws Exception {
+ if (newCS == null)
+ return; // does not exist on this platform
char[] cc = getChars(newCS, oldCS);
System.out.printf(" Diff <%s> <%s>...%n", newCS.name(), oldCS.name());
@@ -120,14 +122,22 @@ public class TestX11CNS {
}
}
+ private static Charset getCharset(String czName)
+ throws Exception {
+ try {
+ return (Charset)Class.forName(czName).newInstance();
+ } catch (ClassNotFoundException e){}
+ return null; // does not exist
+ }
+
public static void main(String[] args) throws Exception {
- compare(new sun.awt.motif.X11CNS11643P1(),
+ compare(getCharset("sun.awt.motif.X11CNS11643P1"),
new X11CNS11643P1());
- compare(new sun.awt.motif.X11CNS11643P2(),
+ compare(getCharset("sun.awt.motif.X11CNS11643P2"),
new X11CNS11643P2());
- compare(new sun.awt.motif.X11CNS11643P3(),
+ compare(getCharset("sun.awt.motif.X11CNS11643P3"),
new X11CNS11643P3());
}