summaryrefslogtreecommitdiff
path: root/libjava/classpath/test/native/lib/PrimlibTest.java
diff options
context:
space:
mode:
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 23:20:01 +0000
committermark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 23:20:01 +0000
commit3b3101d8b5ae4f08a16c0b7111da6cad41bbd282 (patch)
treea5eb7cf42a51869cc8aa1fad7ad6a90cca47fdd8 /libjava/classpath/test/native/lib/PrimlibTest.java
parent7e55c49d7d91ef9f09e93c1100119b1ab3652446 (diff)
downloadgcc-3b3101d8b5ae4f08a16c0b7111da6cad41bbd282.tar.gz
Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated. * Makefile.in: Likewise. * scripts/makemake.tcl: Use glob -nocomplain. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/test/native/lib/PrimlibTest.java')
-rw-r--r--libjava/classpath/test/native/lib/PrimlibTest.java88
1 files changed, 0 insertions, 88 deletions
diff --git a/libjava/classpath/test/native/lib/PrimlibTest.java b/libjava/classpath/test/native/lib/PrimlibTest.java
deleted file mode 100644
index 94b2fb41c3e..00000000000
--- a/libjava/classpath/test/native/lib/PrimlibTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-public class PrimlibTest {
- static {
- System.loadLibrary("jnilinktest");
- }
-
- public static void main(String args[]) {
- Object[] o = new Object[8];
- o[0] = new Boolean(true);
- o[1] = new Byte((byte)1);
- o[2] = new Short((short)2);
- o[3] = new Character((char)3);
- o[4] = new Integer(4);
- o[5] = new Long(5L);
- o[6] = new Float(6F);
- o[7] = new Double(7D);
-
- String[] s = {"boolean", "byte", "short", "char", "int", "long", "float", "double"};
- for(int i=0;i<8;i++) {
- try {
- System.out.println(PrimlibInterface.unwrapBoolean(o[i]) ? "CONVERTED: UnwrapBoolean(" + s[i] + ")" : "INCORRECT: UnwrapBoolean(" + s[i] + ")");
- } catch(Exception E) {
- System.out.println("EXCEPTION: UnwrapBoolean(" + s[i] + ")");
- }
-
- try {
- System.out.println(PrimlibInterface.unwrapByte(o[i]) == i ? "CONVERTED: UnwrapByte(" + s[i] + ")" : "INCORRECT: UnwrapByte(" + s[i] + ")");
- } catch(Exception E) {
- System.out.println("EXCEPTION: UnwrapByte(" + s[i] + ")");
- }
-
- try {
- System.out.println(PrimlibInterface.unwrapShort(o[i]) == i ? "CONVERTED: UnwrapShort(" + s[i] + ")" : "INCORRECT: UnwrapShort(" + s[i] + ")");
- } catch(Exception E) {
- System.out.println("EXCEPTION: UnwrapShort(" + s[i] + ")");
- }
-
- try {
- System.out.println(PrimlibInterface.unwrapChar(o[i]) == i ? "CONVERTED: UnwrapChar(" + s[i] + ")" : "INCORRECT: UnwrapChar(" + s[i] + ")");
- } catch(Exception E) {
- System.out.println("EXCEPTION: UnwrapChar(" + s[i] + ")");
- }
-
- try {
- System.out.println(PrimlibInterface.unwrapInt(o[i]) == i ? "CONVERTED: UnwrapInt(" + s[i] + ")" : "INCORRECT: UnwrapInt(" + s[i] + ")");
- } catch(Exception E) {
- System.out.println("EXCEPTION: UnwrapInt(" + s[i] + ")");
- }
-
- try {
- System.out.println(PrimlibInterface.unwrapLong(o[i]) == i ? "CONVERTED: UnwrapLong(" + s[i] + ")" : "INCORRECT: UnwrapLong(" + s[i] + ")");
- } catch(Exception E) {
- System.out.println("EXCEPTION: UnwrapLong(" + s[i] + ")");
- }
-
- try {
- System.out.println(PrimlibInterface.unwrapFloat(o[i]) == i ? "CONVERTED: UnwrapFloat(" + s[i] + ")" : "INCORRECT: UnwrapFloat(" + s[i] + ")");
- } catch(Exception E) {
- System.out.println("EXCEPTION: UnwrapFloat(" + s[i] + ")");
- }
-
- try {
- System.out.println(PrimlibInterface.unwrapDouble(o[i]) == i ? "CONVERTED: UnwrapDouble(" + s[i] + ")" : "INCORRECT: UnwrapDouble(" + s[i] + ")");
- } catch(Exception E) {
- System.out.println("EXCEPTION: UnwrapDouble(" + s[i] + ")");
- }
- }
- }
-}
-
-class PrimlibInterface {
- static native boolean unwrapBoolean(Object o);
- static native byte unwrapByte(Object o);
- static native short unwrapShort(Object o);
- static native char unwrapChar(Object o);
- static native int unwrapInt(Object o);
- static native long unwrapLong(Object o);
- static native float unwrapFloat(Object o);
- static native double unwrapDouble(Object o);
-
- static native Boolean wrapBoolean(boolean val);
- static native Byte wrapByte(byte val);
- static native Short wrapShort(short val);
- static native Character wrapChar(char val);
- static native Integer wrapInt(int val);
- static native Long wrapLong(long val);
- static native Float wrapFloat(float val);
- static native Double wrapDouble(double val);
-}