tweaks to regression tests

Patrick Tullmann tullmann at cs.utah.edu
Wed Mar 1 10:17:38 PST 2000


I've attached a small patch that tweaks some of the regression tests.
Two will fail with a bit more verbosity and two have a VERBOSE flag so 
that when you encounter a failure its a bit easier to figure out whats 
going on.

-Pat

----- ----- ---- ---  ---  --   -    -      -         -               -
Pat Tullmann                                       tullmann at cs.utah.edu
			  Mean people suck.


Index: test/regression/DoubleComp.java
===================================================================
RCS file: /cvs/kaffe/kaffe/test/regression/DoubleComp.java,v
retrieving revision 1.2
diff -u -r1.2 DoubleComp.java
--- test/regression/DoubleComp.java	1999/04/15 15:59:46	1.2
+++ test/regression/DoubleComp.java	2000/03/01 18:14:53
@@ -1,6 +1,8 @@
 
 public class DoubleComp {
 
+  private final static boolean VERBOSE = false;
+
   private static class TestCase {
     String arg1, arg2, expect;
     double val1, val2;
@@ -12,6 +14,11 @@
       val2 = cvt(arg2);
     }
 
+    public String toString()
+    {
+      return "TestCase(" +arg1+ ", " +arg2+ ") -> " +expect+ ".";
+    }
+
     private static double cvt(String arg) {
       if (arg.equals("1.0"))
 	return 1.0;
@@ -76,6 +83,10 @@
     for (int k = 0; k < tests.length; k++) {
       String exp = tests[k].expect;
       String got;
+
+      if (VERBOSE)
+	System.out.println("Trying " + tests[k]);
+
       try { got = Double.toString(tests[k].val1 / tests[k].val2); }
       catch (Throwable t) { got = t.toString(); }
 
Index: test/regression/ExceptionTestClassLoader.java
===================================================================
RCS file: /cvs/kaffe/kaffe/test/regression/ExceptionTestClassLoader.java,v
retrieving revision 1.2
diff -u -r1.2 ExceptionTestClassLoader.java
--- test/regression/ExceptionTestClassLoader.java	1999/02/12 13:51:08	1.2
+++ test/regression/ExceptionTestClassLoader.java	2000/03/01 18:14:53
@@ -10,7 +10,11 @@
 import java.lang.reflect.*;
 
 public class ExceptionTestClassLoader extends ClassLoader {
+
+  private static final boolean VERBOSE = false;
+
   private Class myLoadClass( String name ) throws ClassNotFoundException {
+    if (VERBOSE) System.out.println("myLoadClass of " +name);
     try {
       if ( name.equals( "ExceptionTest" ) ) {
 	File file = new File( "ExceptionTest" );
@@ -28,6 +32,7 @@
   }
 
   protected Class loadClass( String name, boolean resolve ) throws ClassNotFoundException {
+    if (VERBOSE) System.out.println("loadClass of " +name);
     if (name.equals("java.lang.Exception")) {
        System.out.println("Success 2.");
     }
Index: test/regression/ReaderReadVoidTest.java
===================================================================
RCS file: /cvs/kaffe/kaffe/test/regression/ReaderReadVoidTest.java,v
retrieving revision 1.1
diff -u -r1.1 ReaderReadVoidTest.java
--- test/regression/ReaderReadVoidTest.java	2000/01/12 20:38:17	1.1
+++ test/regression/ReaderReadVoidTest.java	2000/03/01 18:14:53
@@ -11,7 +11,7 @@
 
 public class ReaderReadVoidTest {
 	public static void main(String [] args) {
-		PseudoThread.main(new String[0]);
+		PseudoThread.main(null);
 	}
 }
 
@@ -54,7 +54,7 @@
 		        e.printStackTrace();
 		}
 
-		// with an unsinchronised read() implementation,
+		// with an unsynchronised read() implementation,
 		// both threads will read the same value "2",
 		// with a synchronised one they will read "1" and "2"
 		// (like in the new Kaffe implementation, since they are
@@ -64,14 +64,14 @@
 		        System.out.println("SUCCESS");
 		}
 		else {
-		        System.out.println("FAILURE");
+		        System.out.println("FAILURE: T1 got " +thread1.chrRead+ "; T2 got " +thread2.chrRead);
 		}
 	}
 }
 
 
 class PseudoReader extends Reader {
-	char chrRead = 0;
+	private char chrRead = 0;
 
 	public void close() throws IOException {
 	}


More information about the kaffe mailing list