This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: Fix bogus test cases


This patch fixes some broken test cases in the libjava testsuite that are exposed by an upcoming patch.

pr10459.java: Given the expression "x.clone().clone()", the second clone() call is illegal under JLS section 6.6.2.1 because the type of the qualifier is not a subtype of the type where the access is made from. I've changed it to do the same thing but with its own method.

pr10459_2.java: This test case was identical to pr10459. I've removed it.

inner_data.java: These test case illegally referenced the private field "seed" in java.util.Random. I've changed it to reference a local protected field.

Regards

Bryce


2004-07-09  Bryce McKinlay  <mckinlay@redhat.com>

	Fix or remove some bogus test cases.
	* testsuite/libjava.compile/pr10459_2.java: Removed.
	* testsuite/libjava.compile/pr10459.java: Test using its own method,
	not Object.clone().
	* testsuite/libjava.compile/inner_data.java: Test against its own
	protected field.

Index: inner_data.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/libjava.compile/inner_data.java,v
retrieving revision 1.1
diff -u -r1.1 inner_data.java
--- inner_data.java     12 Feb 2000 22:57:18 -0000      1.1
+++ inner_data.java     9 Jul 2004 23:29:35 -0000
@@ -4,7 +4,7 @@
 
 public class inner_data
 {
-    private class Randomer extends Random {
+    private class Randomer extends Super {
        public long xxx ()
        {
            return seed;
@@ -12,3 +12,7 @@
     }
 }
 
+class Super
+{
+  protected long seed;
+}
Index: pr10459.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/libjava.compile/pr10459.java,v
retrieving revision 1.1
diff -u -r1.1 pr10459.java
--- pr10459.java        3 May 2003 00:33:18 -0000       1.1
+++ pr10459.java        9 Jul 2004 23:29:35 -0000
@@ -4,7 +4,12 @@
 
   public void aMethod() throws Throwable
   {
-    for (; ;x.clone().clone())
+    for (; ;x.foo().foo())
       ;
   }
+  
+  pr10459 foo() 
+  {
+    return null;
+  }
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]