diff options
Diffstat (limited to 'libjava/testsuite/libjava.jar')
20 files changed, 0 insertions, 350 deletions
diff --git a/libjava/testsuite/libjava.jar/ReturnInvocationHandler.java b/libjava/testsuite/libjava.jar/ReturnInvocationHandler.java deleted file mode 100644 index 18b52b73a..0000000 --- a/libjava/testsuite/libjava.jar/ReturnInvocationHandler.java +++ /dev/null @@ -1,24 +0,0 @@ -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; - -public class ReturnInvocationHandler implements InvocationHandler -{ - private Object obj; - public ReturnInvocationHandler(Object obj) - { - this.obj = obj; - } - public Object invoke(Object proxy, Method m, Object[] args) throws Throwable - { - Object result; - try - { - result = m.invoke(obj, args); - } - catch (Exception e) - { - throw e; - } - return result; - } -} diff --git a/libjava/testsuite/libjava.jar/ReturnProxyTest.jar b/libjava/testsuite/libjava.jar/ReturnProxyTest.jar Binary files differdeleted file mode 100644 index 00daabe..0000000 --- a/libjava/testsuite/libjava.jar/ReturnProxyTest.jar +++ /dev/null diff --git a/libjava/testsuite/libjava.jar/ReturnProxyTest.java b/libjava/testsuite/libjava.jar/ReturnProxyTest.java deleted file mode 100644 index bdd0ba9..0000000 --- a/libjava/testsuite/libjava.jar/ReturnProxyTest.java +++ /dev/null @@ -1,27 +0,0 @@ -import java.lang.reflect.Proxy; - -public class ReturnProxyTest -{ - public static void main(String[] args) - { - ReturnTypes orig = new ReturnTypesImpl(); - Object o = Proxy.newProxyInstance(orig.getClass().getClassLoader(), - new Class<?>[] { ReturnTypes.class }, - new ReturnInvocationHandler(orig)); - ReturnTypes rt = (ReturnTypes)o; - - System.out.println(orig.getBoolean()); - System.out.println(orig.getChar()); - System.out.println(orig.getByte()); - System.out.println(orig.getShort()); - System.out.println(orig.getInt()); - System.out.println(orig.getLong()); - - System.out.println(rt.getBoolean()); - System.out.println(rt.getChar()); - System.out.println(rt.getByte()); - System.out.println(rt.getShort()); - System.out.println(rt.getInt()); - System.out.println(rt.getLong()); - } -} diff --git a/libjava/testsuite/libjava.jar/ReturnProxyTest.out b/libjava/testsuite/libjava.jar/ReturnProxyTest.out deleted file mode 100644 index b141f06..0000000 --- a/libjava/testsuite/libjava.jar/ReturnProxyTest.out +++ /dev/null @@ -1,12 +0,0 @@ -false -a --1 --1 --1 --1 -false -a --1 --1 --1 --1 diff --git a/libjava/testsuite/libjava.jar/ReturnProxyTest.xfail b/libjava/testsuite/libjava.jar/ReturnProxyTest.xfail deleted file mode 100644 index 73ffe1d..0000000 --- a/libjava/testsuite/libjava.jar/ReturnProxyTest.xfail +++ /dev/null @@ -1 +0,0 @@ -main=ReturnProxyTest diff --git a/libjava/testsuite/libjava.jar/ReturnTypes.java b/libjava/testsuite/libjava.jar/ReturnTypes.java deleted file mode 100644 index 9fbd6bd..0000000 --- a/libjava/testsuite/libjava.jar/ReturnTypes.java +++ /dev/null @@ -1,9 +0,0 @@ -public interface ReturnTypes -{ - public short getShort(); - public char getChar(); - public byte getByte(); - public int getInt(); - public long getLong(); - public boolean getBoolean(); -} diff --git a/libjava/testsuite/libjava.jar/ReturnTypesImpl.java b/libjava/testsuite/libjava.jar/ReturnTypesImpl.java deleted file mode 100644 index 33fab1b..0000000 --- a/libjava/testsuite/libjava.jar/ReturnTypesImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -public class ReturnTypesImpl implements ReturnTypes -{ - public short getShort() - { - return -1; - } - public char getChar() - { - return 'a'; - } - public byte getByte() - { - return -1; - } - public int getInt() - { - return -1; - } - public long getLong() - { - return -1; - } - public boolean getBoolean() - { - return false; - } -} diff --git a/libjava/testsuite/libjava.jar/TestClosureGC.jar b/libjava/testsuite/libjava.jar/TestClosureGC.jar Binary files differdeleted file mode 100644 index 60d948a..0000000 --- a/libjava/testsuite/libjava.jar/TestClosureGC.jar +++ /dev/null diff --git a/libjava/testsuite/libjava.jar/TestClosureGC.java b/libjava/testsuite/libjava.jar/TestClosureGC.java deleted file mode 100644 index 69a325a..0000000 --- a/libjava/testsuite/libjava.jar/TestClosureGC.java +++ /dev/null @@ -1,116 +0,0 @@ -/* Verify that libffi closures aren't deallocated too early. - - Copyright (C) 2007 Free Software Foundation, Inc - Contributed by Alexandre Oliva <aoliva@redhat.com> - - If libffi closures are released too early, we lose. - */ - -import java.util.HashSet; - -public class TestClosureGC { - public static String objId (Object obj) { - return obj + "/" - + Integer.toHexString(obj.getClass().getClassLoader().hashCode()); - } - public static class cld extends java.net.URLClassLoader { - static final Object obj = new cl0(); - public cld () throws Exception { - super(new java.net.URL[] { }); - /* System.out.println (objId (this) + " created"); */ - } - public void finalize () { - /* System.out.println (objId (this) + " finalized"); */ - } - public String toString () { - return this.getClass().getName() + "@" - + Integer.toHexString (hashCode ()); - } - public Class loadClass (String name) throws ClassNotFoundException { - try { - java.io.InputStream IS = getSystemResourceAsStream - (name + ".class"); - int maxsz = 1024, readsz = 0; - byte buf[] = new byte[maxsz]; - for(;;) { - int readnow = IS.read (buf, readsz, maxsz - readsz); - if (readnow <= 0) - break; - readsz += readnow; - if (readsz == maxsz) { - byte newbuf[] = new byte[maxsz *= 2]; - System.arraycopy (buf, 0, newbuf, 0, readsz); - buf = newbuf; - } - } - return defineClass (name, buf, 0, readsz); - } catch (Exception e) { - return super.loadClass (name); - } - } - } - public static class cl0 { - public cl0 () { - /* System.out.println (objId (this) + " created"); */ - } - public void finalize () { - /* System.out.println (objId (this) + " finalized"); */ - } - } - public static class cl1 { - final HashSet hs; - static final Object obj = new cl0(); - public cl1 (final HashSet hs) { - this.hs = hs; - /* System.out.println (objId (this) + " created"); */ - } - public void finalize () { - /* System.out.println (objId (this) + " finalized"); */ - } - } - public static class cl2 { - final HashSet hs; - static final Object obj = new cl0(); - public cl2 (final HashSet hs) { - this.hs = hs; - /* System.out.println (objId (this) + " created"); */ - } - public void finalize () { - /* System.out.println (objId (this) + " finalized"); */ - hs.add(this); - hs.add(new cl0()); - } - } - static final HashSet hs = new HashSet(); - static final Object obj = new cl0(); - public static void main(String[] argv) throws Exception { - { - Class[] hscs = { HashSet.class }; - Object[] hsos = { hs }; - new cld().loadClass ("TestClosureGC$cl1"). - getConstructor (hscs).newInstance (hsos); - new cld().loadClass ("TestClosureGC$cl2"). - getConstructor (hscs).newInstance (hsos); - new cld().loadClass ("TestClosureGC$cl1"). - getConstructor (hscs).newInstance (hsos); - new cld().loadClass ("TestClosureGC$cl1"). - getConstructor (hscs).newInstance (hsos); - } - for (int i = 1; i <= 5; i++) { - /* System.out.println ("Will run GC and finalization " + i); */ - System.gc (); - Thread.sleep (100); - System.runFinalization (); - Thread.sleep (100); - if (hs.isEmpty ()) - continue; - java.util.Iterator it = hs.iterator (); - while (it.hasNext ()) { - Object obj = it.next(); - /* System.out.println (objId (obj) + " in ht, removing"); */ - it.remove (); - } - } - System.out.println ("ok"); - } -} diff --git a/libjava/testsuite/libjava.jar/TestClosureGC.out b/libjava/testsuite/libjava.jar/TestClosureGC.out deleted file mode 100644 index 9766475..0000000 --- a/libjava/testsuite/libjava.jar/TestClosureGC.out +++ /dev/null @@ -1 +0,0 @@ -ok diff --git a/libjava/testsuite/libjava.jar/TestClosureGC.xfail b/libjava/testsuite/libjava.jar/TestClosureGC.xfail deleted file mode 100644 index 963b35a..0000000 --- a/libjava/testsuite/libjava.jar/TestClosureGC.xfail +++ /dev/null @@ -1 +0,0 @@ -main=TestClosureGC diff --git a/libjava/testsuite/libjava.jar/arraysort.jar b/libjava/testsuite/libjava.jar/arraysort.jar Binary files differdeleted file mode 100644 index ee051e4..0000000 --- a/libjava/testsuite/libjava.jar/arraysort.jar +++ /dev/null diff --git a/libjava/testsuite/libjava.jar/arraysort.java b/libjava/testsuite/libjava.jar/arraysort.java deleted file mode 100644 index 56c181d..0000000 --- a/libjava/testsuite/libjava.jar/arraysort.java +++ /dev/null @@ -1,44 +0,0 @@ -import java.util.Arrays; -import java.util.Comparator; - -public class arraysort -{ - private static final Comparator<String> STRING_COMPARATOR = new Comparator<String>() - { - public int compare(String str1, String str2) - { - return str1.compareTo(str2); - } - }; - - static void dumpArray(String[] strings) - { - int i; - - for (i = 0 ; i < strings.length ; i++) - { - System.out.println("[" + i + "] " + strings[i]); - } - } - - public static void main(String[] args) - { - String[] strings; - - strings = new String[4]; - - strings[0] = "a"; - strings[1] = "c"; - strings[2] = "b"; - strings[3] = "d"; - - System.out.println("Array of string, before:"); - dumpArray(strings); - - Arrays.sort(strings, STRING_COMPARATOR); - - System.out.println("Array of string, after:"); - dumpArray(strings); - } -} - diff --git a/libjava/testsuite/libjava.jar/arraysort.out b/libjava/testsuite/libjava.jar/arraysort.out deleted file mode 100644 index 938ce9f..0000000 --- a/libjava/testsuite/libjava.jar/arraysort.out +++ /dev/null @@ -1,10 +0,0 @@ -Array of string, before: -[0] a -[1] c -[2] b -[3] d -Array of string, after: -[0] a -[1] b -[2] c -[3] d diff --git a/libjava/testsuite/libjava.jar/arraysort.xfail b/libjava/testsuite/libjava.jar/arraysort.xfail deleted file mode 100644 index 2bbbe56..0000000 --- a/libjava/testsuite/libjava.jar/arraysort.xfail +++ /dev/null @@ -1 +0,0 @@ -main=arraysort diff --git a/libjava/testsuite/libjava.jar/jar.exp b/libjava/testsuite/libjava.jar/jar.exp deleted file mode 100644 index e57bcb3..0000000 --- a/libjava/testsuite/libjava.jar/jar.exp +++ /dev/null @@ -1,68 +0,0 @@ -# Tests for .jar files. - -# Compile a single .jar file to an executable. -# Returns 0 on failure. -proc gcj_jar_link {jarfile mainclass} { -} - -proc gcj_jar_compile_one {jarfile mainclass} { - set base [file rootname [file tail $jarfile]] - set out [file rootname $jarfile].out - - if {! [gcj_link $base $mainclass [list $jarfile]]} { - return - } - - gcj_invoke $base $out {} -} - -proc gcj_jar_interpret {jarfile} { - global INTERPRETER srcdir - - set gij [libjava_find_gij] - set errname [dg-trim-dirname $srcdir $jarfile] - # libjava_find_gij will return "" if it couldn't find the - # program; in this case we want to skip the test. - if {$INTERPRETER != "yes" || $gij == ""} { - untested "$errname execution - gij test" - untested "$errname output - gij test" - return - } - - set opts(_) {} - set out [file rootname $jarfile].out - libjava_invoke $errname "gij test" opts $gij {} $out \ - "" -jar $jarfile -} - -proc gcj_jar_run {} { - global srcdir subdir env - foreach jar [lsort [glob -nocomplain ${srcdir}/${subdir}/*.jar]] { - set xff [file rootname $jar].xfail - set main {} - set interp 1 - foreach item [libjava_read_xfail $xff] { - if {[string match main=* $item]} { - set main [string range $item 5 end] - break - } elseif {$item == "no-interpret"} { - set interp 0 - } - } - - gcj_jar_compile_one $jar $main - if {$interp} { - gcj_jar_interpret $jar - } - } - # When we succeed we remove all our clutter. - eval gcj_cleanup [glob -nocomplain -- ${main}.*] [list $main ] - - # Reset CLASSPATH that we do not look into testsuite/libjava.jar for *.jar - # files which do not belong to the libgcj itself. - set env(CLASSPATH) "" - - return 1 -} - -gcj_jar_run diff --git a/libjava/testsuite/libjava.jar/simple.jar b/libjava/testsuite/libjava.jar/simple.jar Binary files differdeleted file mode 100644 index a3359b2..0000000 --- a/libjava/testsuite/libjava.jar/simple.jar +++ /dev/null diff --git a/libjava/testsuite/libjava.jar/simple.java b/libjava/testsuite/libjava.jar/simple.java deleted file mode 100644 index 848ebe1..0000000 --- a/libjava/testsuite/libjava.jar/simple.java +++ /dev/null @@ -1,7 +0,0 @@ -public class simple -{ - public static void main(String[] args) - { - System.out.println("hi"); - } -} diff --git a/libjava/testsuite/libjava.jar/simple.out b/libjava/testsuite/libjava.jar/simple.out deleted file mode 100644 index 45b983b..0000000 --- a/libjava/testsuite/libjava.jar/simple.out +++ /dev/null @@ -1 +0,0 @@ -hi diff --git a/libjava/testsuite/libjava.jar/simple.xfail b/libjava/testsuite/libjava.jar/simple.xfail deleted file mode 100644 index 478dfc7..0000000 --- a/libjava/testsuite/libjava.jar/simple.xfail +++ /dev/null @@ -1 +0,0 @@ -main=simple |