This is the mail archive of the java-patches@sourceware.cygnus.com 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]

Patch: more tests from Alex


Here's a bunch of tests that Alex was using to test the compiler.
Many of these were never checked in before because until recently we
had no way to indicate that the compiler was supposed to give an error
for a particular file.

2000-03-22  Tom Tromey  <tromey@cygnus.com>

	* libjava.compile/iface.java: New file.
	* libjava.compile/static_3.java: New file.
	* libjava.compile/static_2.java: New file.
	* libjava.compile/static_1.xfail: New file.
	* libjava.compile/static_1.java: New file.
	* libjava.compile/redef6.xfail: New file.
	* libjava.compile/redef6.java: New file.
	* libjava.compile/redef5.xfail: New file.
	* libjava.compile/redef5.java: New file.
	* libjava.compile/redef4.xfail: New file.
	* libjava.compile/redef4.java: New file.
	* libjava.compile/redef3.xfail: New file.
	* libjava.compile/redef3.java: New file.
	* libjava.compile/redef2.xfail: New file.
	* libjava.compile/redef2.java: New file.
	* libjava.compile/redef1.xfail: New file.
	* libjava.compile/redef1.java: New file.
	* libjava.compile/not_a_redef.java: New file.
	* libjava.compile/inner_1.java: New file.
	* libjava.compile/static_init.xfail: New file.
	* libjava.compile/static_init.java: New file.

Tom

Index: libjava.compile/iface.java
===================================================================
RCS file: iface.java
diff -N iface.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ iface.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,24 @@
+// Test for searching through interface extension.
+
+interface basei
+{
+  public int method ();
+}
+
+interface basei2
+{
+  public int confuse ();
+}
+
+interface derivedi extends basei, basei2
+{
+  public void nothing ();
+}
+
+public class iface
+{
+  public int try_it (derivedi x)
+  {
+    return x.method ();
+  }
+}
Index: libjava.compile/inner_1.java
===================================================================
RCS file: inner_1.java
diff -N inner_1.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ inner_1.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,36 @@
+// inner class regression test.
+
+package bar.foo;
+
+class other {
+  class foo {}
+}
+
+class inner_1 {
+    static void bar () {
+        inner_1 xxxx;			// Refers to inner_1
+	bar.foo.another xyz;		// Refers to non inner another 
+	bar.foo.other.foo X;		// OK to declare, inner class foo
+	bar.foo.inner_1.t bar;		// Inner class t
+	inner_1.t foo;			// Inner class t
+	t foobar;			// Inner class t
+	other.foo zag;			// Valid for declaration.
+	t.ungah x;
+    }
+    void foo () {
+	// z.t.u foo;
+	t t1 = new t();
+        t1.print (); 
+	new t().print();
+    }
+
+    class t {
+	void print () {
+	    System.out.println ("This is `inner_1.t'");
+	}
+	class ungah {}
+    }
+}
+
+class another {
+} 
Index: libjava.compile/not_a_redef.java
===================================================================
RCS file: not_a_redef.java
diff -N not_a_redef.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ not_a_redef.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,6 @@
+package bar.foo;
+// This is not a redef.
+
+class not_a_redef {
+ class baz { class bar { class foo {}} class foo {}}	
+}
Index: libjava.compile/redef1.java
===================================================================
RCS file: redef1.java
diff -N redef1.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ redef1.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,6 @@
+package bar.foo;
+// A case of innerclass redefinition
+
+class redef1 {
+    class redef1 {}
+}
Index: libjava.compile/redef1.xfail
===================================================================
RCS file: redef1.xfail
diff -N redef1.xfail
--- /dev/null	Tue May  5 13:32:27 1998
+++ redef1.xfail	Wed Mar 22 13:17:37 2000
@@ -0,0 +1 @@
+shouldfail
Index: libjava.compile/redef2.java
===================================================================
RCS file: redef2.java
diff -N redef2.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ redef2.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,6 @@
+package bar.foo;
+// A case of innerclass redefinition
+
+class redef2 {
+    class foo {class redef2{}}
+}
Index: libjava.compile/redef2.xfail
===================================================================
RCS file: redef2.xfail
diff -N redef2.xfail
--- /dev/null	Tue May  5 13:32:27 1998
+++ redef2.xfail	Wed Mar 22 13:17:37 2000
@@ -0,0 +1 @@
+shouldfail
Index: libjava.compile/redef3.java
===================================================================
RCS file: redef3.java
diff -N redef3.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ redef3.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,6 @@
+package bar.foo;
+// A case of innerclass redefinition
+
+class redef3 {
+  class foo { class bar {} class bar {}}
+}
Index: libjava.compile/redef3.xfail
===================================================================
RCS file: redef3.xfail
diff -N redef3.xfail
--- /dev/null	Tue May  5 13:32:27 1998
+++ redef3.xfail	Wed Mar 22 13:17:37 2000
@@ -0,0 +1 @@
+shouldfail
Index: libjava.compile/redef4.java
===================================================================
RCS file: redef4.java
diff -N redef4.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ redef4.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,6 @@
+package bar.foo;
+// A case of innerclass redefinition
+
+class redef4 {
+  class foo { class bar { class foo {}}}
+}
Index: libjava.compile/redef4.xfail
===================================================================
RCS file: redef4.xfail
diff -N redef4.xfail
--- /dev/null	Tue May  5 13:32:27 1998
+++ redef4.xfail	Wed Mar 22 13:17:37 2000
@@ -0,0 +1 @@
+shouldfail
Index: libjava.compile/redef5.java
===================================================================
RCS file: redef5.java
diff -N redef5.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ redef5.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,6 @@
+package bar.foo;
+// Redefining and stuffing the redefined class with something
+
+class redef5 {
+  class redef5 {void foobar() {}}
+}
Index: libjava.compile/redef5.xfail
===================================================================
RCS file: redef5.xfail
diff -N redef5.xfail
--- /dev/null	Tue May  5 13:32:27 1998
+++ redef5.xfail	Wed Mar 22 13:17:37 2000
@@ -0,0 +1 @@
+shouldfail
Index: libjava.compile/redef6.java
===================================================================
RCS file: redef6.java
diff -N redef6.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ redef6.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,6 @@
+package bar.foo;
+// Redefining and stuffing the redefined class with something
+
+class redef6 {
+  class redef6 {int foo;}
+}
Index: libjava.compile/redef6.xfail
===================================================================
RCS file: redef6.xfail
diff -N redef6.xfail
--- /dev/null	Tue May  5 13:32:27 1998
+++ redef6.xfail	Wed Mar 22 13:17:37 2000
@@ -0,0 +1 @@
+shouldfail
Index: libjava.compile/static_1.java
===================================================================
RCS file: static_1.java
diff -N static_1.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ static_1.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,12 @@
+package bar.foo;
+
+class static_1 {
+    class bar {
+	// No Static members: methods, fields, inner classes.
+	static int foo;			
+	static int xyzzy (){return 0;}
+	static {}		
+	static class foo {}
+	// No Member interface FIXME
+        }
+}
Index: libjava.compile/static_1.xfail
===================================================================
RCS file: static_1.xfail
diff -N static_1.xfail
--- /dev/null	Tue May  5 13:32:27 1998
+++ static_1.xfail	Wed Mar 22 13:17:37 2000
@@ -0,0 +1 @@
+shouldfail
Index: libjava.compile/static_2.java
===================================================================
RCS file: static_2.java
diff -N static_2.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ static_2.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,10 @@
+package bar.foo;
+
+class static_2 {
+	static class koink {
+	 	static int i;					
+		static void foo (){}				
+		static {}					
+		static class foo {}				
+	}
+}
Index: libjava.compile/static_3.java
===================================================================
RCS file: static_3.java
diff -N static_3.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ static_3.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,5 @@
+package bar.foo;
+
+class static_3 {
+    static class zoink { static class zork {}}
+}
Index: libjava.compile/static_init.java
===================================================================
RCS file: static_init.java
diff -N static_init.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ static_init.java	Wed Mar 22 13:17:37 2000
@@ -0,0 +1,4 @@
+class static_init
+{
+  native { }
+}
Index: libjava.compile/static_init.xfail
===================================================================
RCS file: static_init.xfail
diff -N static_init.xfail
--- /dev/null	Tue May  5 13:32:27 1998
+++ static_init.xfail	Wed Mar 22 13:17:37 2000
@@ -0,0 +1 @@
+shouldfail

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