* tests/native: Moved to tests/regression/native.
authortwisti <none@none>
Sun, 22 Jan 2006 20:21:31 +0000 (20:21 +0000)
committertwisti <none@none>
Sun, 22 Jan 2006 20:21:31 +0000 (20:21 +0000)
--HG--
rename : tests/native/.cvsignore => tests/regression/native/.cvsignore
rename : tests/native/Makefile.am => tests/regression/native/Makefile.am
rename : tests/native/checkjni.c => tests/regression/native/checkjni.c
rename : tests/native/checkjni.java => tests/regression/native/checkjni.java
rename : tests/native/checkjni.output => tests/regression/native/checkjni.output
rename : tests/native/test.c => tests/regression/native/test.c
rename : tests/native/test.java => tests/regression/native/test.java
rename : tests/native/test.output => tests/regression/native/test.output
rename : tests/native/testarguments.c => tests/regression/native/testarguments.c
rename : tests/native/testarguments.java => tests/regression/native/testarguments.java
rename : tests/native/testarguments.output => tests/regression/native/testarguments.output
rename : tests/native/testgetobjectclass0.c => tests/regression/native/testgetobjectclass0.c
rename : tests/native/testgetobjectclass0.java => tests/regression/native/testgetobjectclass0.java

26 files changed:
tests/native/.cvsignore [deleted file]
tests/native/Makefile.am [deleted file]
tests/native/checkjni.c [deleted file]
tests/native/checkjni.java [deleted file]
tests/native/checkjni.output [deleted file]
tests/native/test.c [deleted file]
tests/native/test.java [deleted file]
tests/native/test.output [deleted file]
tests/native/testarguments.c [deleted file]
tests/native/testarguments.java [deleted file]
tests/native/testarguments.output [deleted file]
tests/native/testgetobjectclass0.c [deleted file]
tests/native/testgetobjectclass0.java [deleted file]
tests/regression/native/.cvsignore [new file with mode: 0644]
tests/regression/native/Makefile.am [new file with mode: 0644]
tests/regression/native/checkjni.c [new file with mode: 0644]
tests/regression/native/checkjni.java [new file with mode: 0644]
tests/regression/native/checkjni.output [new file with mode: 0644]
tests/regression/native/test.c [new file with mode: 0644]
tests/regression/native/test.java [new file with mode: 0644]
tests/regression/native/test.output [new file with mode: 0644]
tests/regression/native/testarguments.c [new file with mode: 0644]
tests/regression/native/testarguments.java [new file with mode: 0644]
tests/regression/native/testarguments.output [new file with mode: 0644]
tests/regression/native/testgetobjectclass0.c [new file with mode: 0644]
tests/regression/native/testgetobjectclass0.java [new file with mode: 0644]

diff --git a/tests/native/.cvsignore b/tests/native/.cvsignore
deleted file mode 100644 (file)
index 94cc1ce..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-*.class
-Makefile
-Makefile.in
diff --git a/tests/native/Makefile.am b/tests/native/Makefile.am
deleted file mode 100644 (file)
index 9fb5b4b..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-## src/tests/native/Makefile.am
-##
-## Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-## R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-## C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-## Institut f. Computersprachen - TU Wien
-##
-## This file is part of CACAO.
-##
-## This program is free software; you can redistribute it and/or
-## modify it under the terms of the GNU General Public License as
-## published by the Free Software Foundation; either version 2, or (at
-## your option) any later version.
-##
-## This program is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-## 02111-1307, USA.
-##
-## Contact: cacao@complang.tuwien.ac.at
-##
-## Authors: Christian Thalinger
-##
-## Changes:
-##
-## $Id: Makefile.am 4094 2006-01-08 19:14:17Z twisti $
-
-## Process this file with automake to produce Makefile.in
-
-INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR)
-
-CLEANFILES = \
-       libcheckjni.so \
-       checkjni.class \
-       checkjni.h \
-       \
-       libtestarguments.so \
-       testarguments.class \
-       testarguments.h
-
-JAVA = $(top_builddir)/src/cacao/cacao
-JAVAH = $(top_builddir)/src/cacaoh/cacaoh
-
-checkall: test.tst checkjni.tst testarguments.tst
-
-test:
-       $(JAVAC) test.java
-       $(JAVAH) test
-       $(CC) -shared $(INCLUDES) $(CFLAGS) test.c -o libtest.so -fPIC
-
-checkjni:
-       $(JAVAC) checkjni.java
-       $(JAVAH) checkjni
-       $(CC) -shared $(INCLUDES) $(CFLAGS) checkjni.c -o libcheckjni.so -fPIC
-
-testarguments:
-       $(JAVAC) testarguments.java
-       $(JAVAH) testarguments
-       $(CC) -shared $(INCLUDES) $(CFLAGS) testarguments.c -o libtestarguments.so -fPIC
-       $(JAVAC) testgetobjectclass0.java
-       $(JAVAH) testgetobjectclass0
-       $(CC) -shared $(INCLUDES) $(CFLAGS) testgetobjectclass0.c -o libtestgetobjectclass0.so -fPIC
-
-%.tst: %
-       sh ../Test.sh $(JAVA) $*
-       rm -f $*.thisoutput
-       rm -f $*.this2output
-
-## Local variables:
-## mode: Makefile
-## indent-tabs-mode: t
-## c-basic-offset: 4
-## tab-width: 8
-## compile-command: "automake --add-missing"
-## End:
diff --git a/tests/native/checkjni.c b/tests/native/checkjni.c
deleted file mode 100644 (file)
index 08349ef..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/* src/tests/native/checkjni.c - for testing JNI stuff
-
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-   TU Wien
-
-   This file is part of CACAO.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
-
-   Contact: cacao@complang.tuwien.ac.at
-
-   Authors: Christian Thalinger
-
-   Changes:
-
-   $Id: checkjni.c 2170 2005-03-31 19:18:38Z twisti $
-
-*/
-
-
-#include <stdio.h>
-
-#include "config.h"
-#include "native/jni.h"
-
-
-JNIEXPORT jboolean JNICALL Java_checkjni_IsAssignableFrom(JNIEnv *env, jclass clazz, jclass sub, jclass sup)
-{
-  return (*env)->IsAssignableFrom(env, sub, sup);
-}
-
-JNIEXPORT jboolean JNICALL Java_checkjni_IsInstanceOf(JNIEnv *env, jclass clazz, jobject obj, jclass c)
-{
-  return (*env)->IsInstanceOf(env, obj, c);
-}
diff --git a/tests/native/checkjni.java b/tests/native/checkjni.java
deleted file mode 100644 (file)
index d55a1f2..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* src/tests/native/checkjni.java - for testing JNI related stuff
-
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-   TU Wien
-
-   This file is part of CACAO.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
-
-   Contact: cacao@complang.tuwien.ac.at
-
-   Authors: Christian Thalinger
-
-   Changes:
-
-   $Id: checkjni.java 2170 2005-03-31 19:18:38Z twisti $
-
-*/
-
-
-public class checkjni {
-    public native boolean IsAssignableFrom(Class sub, Class sup);
-    public native boolean IsInstanceOf(Object obj, Class clazz);
-
-    public static void main(String[] argv) {
-        System.loadLibrary("checkjni");
-
-        new checkjni();
-    }
-
-    public checkjni() {
-        checkIsAssignableFrom();
-        checkIsInstanceOf();
-    }
-
-    void checkIsAssignableFrom() {
-        p("IsAssignableFrom:");
-
-        Class sub = Integer.class;
-        Class sup = Object.class;
-
-        equal(IsAssignableFrom(sup, sup), true);
-        equal(IsAssignableFrom(sub, sup), true);
-        equal(IsAssignableFrom(sup, sub), false);
-    }
-
-    void checkIsInstanceOf() {
-        p("IsInstanceOf:");
-
-        Object obj = new Object();
-        Object obj2 = new Integer(1);
-        Class clazz = Object.class;
-        Class clazz2 = Integer.class;
-
-        equal(IsInstanceOf(obj, clazz), true);
-        equal(IsInstanceOf(obj2, clazz), true);
-        equal(IsInstanceOf(obj, clazz2), false);
-    }
-
-    void equal(boolean a, boolean b) {
-        if (a == b)
-            p("PASS");
-        else
-            p("FAILED");
-    }
-
-    void p(String s) {
-        System.out.println(s);
-    }
-}
diff --git a/tests/native/checkjni.output b/tests/native/checkjni.output
deleted file mode 100644 (file)
index 04f17d8..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-IsAssignableFrom:
-PASS
-PASS
-PASS
-IsInstanceOf:
-PASS
-PASS
-PASS
diff --git a/tests/native/test.c b/tests/native/test.c
deleted file mode 100644 (file)
index fc99f30..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/* tests/native/test.c - for testing native stuff
-
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-   TU Wien
-
-   This file is part of CACAO.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
-
-   Contact: cacao@complang.tuwien.ac.at
-
-   Authors: Christian Thalinger
-
-   $Id: test.c 1899 2005-02-08 13:43:33Z twisti $
-
-*/
-
-
-#include <stdio.h>
-
-#include "config.h"
-#include "native/jni.h"
-
-
-JNIEXPORT void JNICALL Java_test_nsub(JNIEnv *env, jclass clazz)
-{
-    jint version = (*env)->GetVersion(env);
-    printf("JNI Version: %d\n", version);
-}
diff --git a/tests/native/test.java b/tests/native/test.java
deleted file mode 100644 (file)
index 33958c2..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/* tests/native/test.java - file for testing native related stuff
-
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-   TU Wien
-
-   This file is part of CACAO.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
-
-   Contact: cacao@complang.tuwien.ac.at
-
-   Authors: Christian Thalinger
-
-   $Id: test.java 1899 2005-02-08 13:43:33Z twisti $
-
-*/
-
-
-public class test {
-    public static native void nsub();
-
-    public static void main(String[] argv) {
-        System.loadLibrary("test");
-        nsub();
-    }
-}
diff --git a/tests/native/test.output b/tests/native/test.output
deleted file mode 100644 (file)
index 0cac2af..0000000
+++ /dev/null
@@ -1 +0,0 @@
-JNI Version: 65540
diff --git a/tests/native/testarguments.c b/tests/native/testarguments.c
deleted file mode 100644 (file)
index 8752f32..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/* tests/native/testarguments.c - tests argument passing
-
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-   TU Wien
-
-   This file is part of CACAO.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
-
-   Contact: cacao@complang.tuwien.ac.at
-
-   Authors: Christian Thalinger
-
-   $Id: testarguments.c 3522 2005-10-28 18:07:00Z twisti $
-
-*/
-
-
-#include <stdio.h>
-
-#include "config.h"
-#include "native/jni.h"
-
-
-JNIEXPORT void JNICALL Java_testarguments_nisub(JNIEnv *env, jclass clazz, jint a, jint b, jint c, jint d, jint e, jint f, jint g, jint h, jint i, jint j, jint k, jint l, jint m, jint n, jint o)
-{
-    jmethodID mid;
-
-    printf("java-native: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
-    fflush(stdout);
-
-    mid = (*env)->GetStaticMethodID(env, clazz, "jisub", "(IIIIIIIIIIIIIII)V");
-
-    if (mid == 0) {
-        printf("native: couldn't find jisub\n");
-        return;
-    }
-
-    (*env)->CallStaticVoidMethod(env, clazz, mid, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
-}
-
-
-JNIEXPORT void JNICALL Java_testarguments_nlsub(JNIEnv *env, jclass clazz, jlong a, jlong b, jlong c, jlong d, jlong e, jlong f, jlong g, jlong h, jlong i, jlong j, jlong k, jlong l, jlong m, jlong n, jlong o)
-{
-    jmethodID mid;
-
-#if SIZEOF_VOID_P == 4
-    printf("java-native: 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx\n", a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
-#else
-    printf("java-native: 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n", a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
-#endif
-    fflush(stdout);
-
-    mid = (*env)->GetStaticMethodID(env, clazz, "jlsub", "(JJJJJJJJJJJJJJJ)V");
-
-    if (mid == 0) {
-        printf("native: couldn't find jlsub\n");
-        return;
-    }
-
-    (*env)->CallStaticVoidMethod(env, clazz, mid, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
-}
-
-
-JNIEXPORT void JNICALL Java_testarguments_nfsub(JNIEnv *env, jclass clazz, jfloat a, jfloat b, jfloat c, jfloat d, jfloat e, jfloat f, jfloat g, jfloat h, jfloat i, jfloat j, jfloat k, jfloat l, jfloat m, jfloat n, jfloat o)
-{
-    jmethodID mid;
-    union {
-      jint i;
-      jfloat f;
-    } x;
-
-    printf("java-native:");
-
-    x.f = a; printf(" 0x%x", x.i);
-    x.f = b; printf(" 0x%x", x.i);
-    x.f = c; printf(" 0x%x", x.i);
-    x.f = d; printf(" 0x%x", x.i);
-    x.f = e; printf(" 0x%x", x.i);
-    x.f = f; printf(" 0x%x", x.i);
-    x.f = g; printf(" 0x%x", x.i);
-    x.f = h; printf(" 0x%x", x.i);
-    x.f = i; printf(" 0x%x", x.i);
-    x.f = j; printf(" 0x%x", x.i);
-    x.f = k; printf(" 0x%x", x.i);
-    x.f = l; printf(" 0x%x", x.i);
-    x.f = m; printf(" 0x%x", x.i);
-    x.f = n; printf(" 0x%x", x.i);
-    x.f = o; printf(" 0x%x", x.i);
-
-    printf("\n");
-    fflush(stdout);
-
-    mid = (*env)->GetStaticMethodID(env, clazz, "jfsub", "(FFFFFFFFFFFFFFF)V");
-
-    if (mid == 0) {
-        printf("native: couldn't find jfsub\n");
-        return;
-    }
-
-    (*env)->CallStaticVoidMethod(env, clazz, mid, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
-}
-
-
-JNIEXPORT void JNICALL Java_testarguments_ndsub(JNIEnv *env, jclass clazz, jdouble a, jdouble b, jdouble c, jdouble d, jdouble e, jdouble f, jdouble g, jdouble h, jdouble i, jdouble j, jdouble k, jdouble l, jdouble m, jdouble n, jdouble o)
-{
-    jmethodID mid;
-    union {
-      jlong l;
-      jdouble d;
-    } x;
-
-    printf("java-native:");
-
-#if SIZEOF_VOID_P == 4
-    x.d = a; printf(" 0x%llx", x.l);
-    x.d = b; printf(" 0x%llx", x.l);
-    x.d = c; printf(" 0x%llx", x.l);
-    x.d = d; printf(" 0x%llx", x.l);
-    x.d = e; printf(" 0x%llx", x.l);
-    x.d = f; printf(" 0x%llx", x.l);
-    x.d = g; printf(" 0x%llx", x.l);
-    x.d = h; printf(" 0x%llx", x.l);
-    x.d = i; printf(" 0x%llx", x.l);
-    x.d = j; printf(" 0x%llx", x.l);
-    x.d = k; printf(" 0x%llx", x.l);
-    x.d = l; printf(" 0x%llx", x.l);
-    x.d = m; printf(" 0x%llx", x.l);
-    x.d = n; printf(" 0x%llx", x.l);
-    x.d = o; printf(" 0x%llx", x.l);
-#else
-    x.d = a; printf(" 0x%lx", x.l);
-    x.d = b; printf(" 0x%lx", x.l);
-    x.d = c; printf(" 0x%lx", x.l);
-    x.d = d; printf(" 0x%lx", x.l);
-    x.d = e; printf(" 0x%lx", x.l);
-    x.d = f; printf(" 0x%lx", x.l);
-    x.d = g; printf(" 0x%lx", x.l);
-    x.d = h; printf(" 0x%lx", x.l);
-    x.d = i; printf(" 0x%lx", x.l);
-    x.d = j; printf(" 0x%lx", x.l);
-    x.d = k; printf(" 0x%lx", x.l);
-    x.d = l; printf(" 0x%lx", x.l);
-    x.d = m; printf(" 0x%lx", x.l);
-    x.d = n; printf(" 0x%lx", x.l);
-    x.d = o; printf(" 0x%lx", x.l);
-#endif
-
-    printf("\n");
-    fflush(stdout);
-
-    mid = (*env)->GetStaticMethodID(env, clazz, "jdsub", "(DDDDDDDDDDDDDDD)V");
-
-    if (mid == 0) {
-        printf("native: couldn't find jfsub\n");
-        return;
-    }
-
-    (*env)->CallStaticVoidMethod(env, clazz, mid, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
-}
diff --git a/tests/native/testarguments.java b/tests/native/testarguments.java
deleted file mode 100644 (file)
index 1dcdee5..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/* tests/native/testarguments.java - tests argument passing
-
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-   TU Wien
-
-   This file is part of CACAO.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
-
-   Contact: cacao@complang.tuwien.ac.at
-
-   Authors: Christian Thalinger
-
-   $Id: testarguments.java 3523 2005-10-28 19:56:29Z twisti $
-
-*/
-
-
-import java.util.*;
-
-public class testarguments {
-    static Random r;
-
-    public static native void nisub(int a, int b, int c, int d, int e,
-                                    int f, int g, int h, int i, int j,
-                                    int k, int l, int m, int n, int o);
-
-    public static native void nlsub(long a, long b, long c, long d, long e,
-                                    long f, long g, long h, long i, long j,
-                                    long k, long l, long m, long n, long o);
-
-    public static native void nfsub(float a, float b, float c, float d, float e,
-                                    float f, float g, float h, float i, float j,
-                                    float k, float l, float m, float n, float o);
-
-    public static native void ndsub(double a, double b, double c, double d, double e,
-                                    double f, double g, double h, double i, double j,
-                                    double k, double l, double m, double n, double o);
-
-    public static void main(String[] argv) {
-        r = new Random(0);
-
-        System.loadLibrary("testarguments");
-
-        itest();
-        ltest();
-        ftest();
-        dtest();
-    }
-
-    static void itest() {
-        pln("testing int --------------------------------------------------");
-
-        isub(0x11111111, 0x22222222, 0x33333333, 0x44444444, 0x55555555,
-             0x66666666, 0x77777777, 0x88888888, 0x99999999, 0xaaaaaaaa,
-             0xbbbbbbbb, 0xcccccccc, 0xdddddddd, 0xeeeeeeee, 0xffffffff);
-
-        pln();
-    }
-
-    static void ltest() {
-        pln("testing long -------------------------------------------------");
-
-        lsub(0x1111111111111111L, 0x2222222222222222L, 0x3333333333333333L,
-             0x4444444444444444L, 0x5555555555555555L, 0x6666666666666666L,
-             0x7777777777777777L, 0x8888888888888888L, 0x9999999999999999L,
-             0xaaaaaaaaaaaaaaaaL, 0xbbbbbbbbbbbbbbbbL, 0xccccccccccccccccL,
-             0xddddddddddddddddL, 0xeeeeeeeeeeeeeeeeL, 0xffffffffffffffffL);
-
-        pln();
-    }
-
-    static void ftest() {
-        pln("testing float ------------------------------------------------");
-
-        fsub(i2f(0x11111111), i2f(0x22222222), i2f(0x33333333),
-             i2f(0x44444444), i2f(0x55555555), i2f(0x66666666),
-             i2f(0x77777777), i2f(0x88888888), i2f(0x99999999),
-             i2f(0xaaaaaaaa), i2f(0xbbbbbbbb), i2f(0xcccccccc),
-             i2f(0xdddddddd), i2f(0xeeeeeeee), i2f(0xffffffff));
-
-        pln();
-    }
-
-    static void dtest() {
-        pln("testing double -----------------------------------------------");
-
-        dsub(l2d(0x1111111111111111L), l2d(0x2222222222222222L),
-             l2d(0x3333333333333333L), l2d(0x4444444444444444L),
-             l2d(0x5555555555555555L), l2d(0x6666666666666666L),
-             l2d(0x7777777777777777L), l2d(0x8888888888888888L),
-             l2d(0x9999999999999999L), l2d(0xaaaaaaaaaaaaaaaaL),
-             l2d(0xbbbbbbbbbbbbbbbbL), l2d(0xccccccccccccccccL),
-             l2d(0xddddddddddddddddL), l2d(0xeeeeeeeeeeeeeeeeL),
-             l2d(0xffffffffffffffffL));
-    }
-
-
-    // test java-java argument passing
-
-    public static void isub(int a, int b, int c, int d, int e,
-                            int f, int g, int h, int i, int j,
-                            int k, int l, int m, int n, int o) {
-        p("java-java  :");
-
-        p(a); p(b); p(c); p(d); p(e);
-        p(f); p(g); p(h); p(i); p(j);
-        p(k); p(l); p(m); p(n); p(o);
-
-        pln();
-
-        nisub(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
-    }
-
-    public static void lsub(long a, long b, long c, long d, long e,
-                            long f, long g, long h, long i, long j,
-                            long k, long l, long m, long n, long o) {
-        p("java-java  :");
-
-        p(a); p(b); p(c); p(d); p(e);
-        p(f); p(g); p(h); p(i); p(j);
-        p(k); p(l); p(m); p(n); p(o);
-
-        pln();
-
-        nlsub(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
-    }
-
-    public static void fsub(float a, float b, float c, float d, float e,
-                            float f, float g, float h, float i, float j,
-                            float k, float l, float m, float n, float o) {
-        p("java-java  :");
-
-        p(a); p(b); p(c); p(d); p(e);
-        p(f); p(g); p(h); p(i); p(j);
-        p(k); p(l); p(m); p(n); p(o);
-
-        pln();
-
-        nfsub(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
-    }
-
-    public static void dsub(double a, double b, double c, double d, double e,
-                            double f, double g, double h, double i, double j,
-                            double k, double l, double m, double n, double o) {
-        p("java-java  :");
-
-        p(a); p(b); p(c); p(d); p(e);
-        p(f); p(g); p(h); p(i); p(j);
-        p(k); p(l); p(m); p(n); p(o);
-
-        pln();
-
-        ndsub(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
-    }
-
-
-    // test native-java argument passing
-
-    public static void jisub(int a, int b, int c, int d, int e,
-                             int f, int g, int h, int i, int j,
-                             int k, int l, int m, int n, int o) {
-        p("native-java:");
-
-        p(a); p(b); p(c); p(d); p(e);
-        p(f); p(g); p(h); p(i); p(j);
-        p(k); p(l); p(m); p(n); p(o);
-
-        pln();
-    }
-
-    public static void jlsub(long a, long b, long c, long d, long e,
-                             long f, long g, long h, long i, long j,
-                             long k, long l, long m, long n, long o) {
-        p("native-java:");
-
-        p(a); p(b); p(c); p(d); p(e);
-        p(f); p(g); p(h); p(i); p(j);
-        p(k); p(l); p(m); p(n); p(o);
-
-        pln();
-    }
-
-    public static void jfsub(float a, float b, float c, float d, float e,
-                             float f, float g, float h, float i, float j,
-                             float k, float l, float m, float n, float o) {
-        p("native-java:");
-
-        p(a); p(b); p(c); p(d); p(e);
-        p(f); p(g); p(h); p(i); p(j);
-        p(k); p(l); p(m); p(n); p(o);
-
-        pln();
-    }
-
-    public static void jdsub(double a, double b, double c, double d, double e,
-                             double f, double g, double h, double i, double j,
-                             double k, double l, double m, double n, double o) {
-        p("native-java:");
-
-        p(a); p(b); p(c); p(d); p(e);
-        p(f); p(g); p(h); p(i); p(j);
-        p(k); p(l); p(m); p(n); p(o);
-
-        pln();
-    }
-
-    static float i2f(int i) {
-        return Float.intBitsToFloat(i);
-    }
-
-    static double l2d(long l) {
-        return Double.longBitsToDouble(l);
-    }
-
-    static void p(String s) { System.out.print(s); }
-
-    static void p(int i) {
-        System.out.print(" 0x" + Integer.toHexString(i));
-    }
-
-    static void p(long l) {
-        System.out.print(" 0x" + Long.toHexString(l));
-    }
-
-    static void p(float f) {
-        p(Float.floatToIntBits(f));
-    }
-
-    static void p(double d) {
-        p(Double.doubleToLongBits(d));
-    }
-
-    static void pln() { System.out.println(); }
-    static void pln(String s) { System.out.println(s); }
-}
diff --git a/tests/native/testarguments.output b/tests/native/testarguments.output
deleted file mode 100644 (file)
index 7ecb9f2..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-testing int --------------------------------------------------
-java-java  : -1155484576 -723955400 1033096058 -1690734402 -1557280266 1327362106 -1930858313 502539523 -1728529858 -938301587 1431162155 1085665355 1654374947 -1661998771 -65105105
-java-native: -1155484576 -723955400 1033096058 -1690734402 -1557280266 1327362106 -1930858313 502539523 -1728529858 -938301587 1431162155 1085665355 1654374947 -1661998771 -65105105
-native-java: -1155484576 -723955400 1033096058 -1690734402 -1557280266 1327362106 -1930858313 502539523 -1728529858 -938301587 1431162155 1085665355 1654374947 -1661998771 -65105105
-
-testing long -------------------------------------------------
-java-java  : -316923953663567096 425784808157066482 3246199166113899023 5772649832669734744 6787954838522539928 -5438565800896958689 25579809655956232 170168523965373507 -8062155292093192501 4664870386390374308 5274012497411174555 275355961613117157 -429849028627267071 -5751058041584006506 -2440897930508784356
-java-native: -316923953663567096 425784808157066482 3246199166113899023 5772649832669734744 6787954838522539928 -5438565800896958689 25579809655956232 170168523965373507 -8062155292093192501 4664870386390374308 5274012497411174555 275355961613117157 -429849028627267071 -5751058041584006506 -2440897930508784356
-native-java: -316923953663567096 425784808157066482 3246199166113899023 5772649832669734744 6787954838522539928 -5438565800896958689 25579809655956232 170168523965373507 -8062155292093192501 4664870386390374308 5274012497411174555 275355961613117157 -429849028627267071 -5751058041584006506 -2440897930508784356
-
-testing float ------------------------------------------------
-java-java  : 0.9809451 0.73315203 0.57003427 0.81729704 0.012806594 0.8388903 0.41221774 0.5266994 0.7257748 0.89933497 0.9846741 0.1339398 0.5461274 0.08306235 0.18598962
-java-native: 0.98094511 0.73315203 0.57003427 0.81729704 0.01280659 0.83889031 0.41221774 0.52669942 0.72577482 0.89933497 0.98467410 0.13393980 0.54612738 0.08306235 0.18598962
-native-java: 0.9809451 0.73315203 0.57003427 0.81729704 0.012806594 0.8388903 0.41221774 0.5266994 0.7257748 0.89933497 0.9846741 0.1339398 0.5461274 0.08306235 0.18598962
-
-testing double -----------------------------------------------
-java-java  : 0.9785743401478403 0.7223571191888487 0.7150310138504744 0.14322038530059678 0.4629578184224229 0.004485602182885184 0.07149831487989411 0.34842022979166454 0.3387696535357536 0.859356551354648 0.9715469888517128 0.8657458802140383 0.6125811047098682 0.17898798452881726 0.21757041220968598
-java-native: 0.9785743401478403 0.7223571191888487 0.7150310138504744 0.1432203853005968 0.4629578184224229 0.004485602182885184 0.07149831487989411 0.3484202297916645 0.3387696535357536 0.8593565513546479 0.9715469888517128 0.8657458802140383 0.6125811047098682 0.1789879845288173 0.217570412209686
-native-java: 0.9785743401478403 0.7223571191888487 0.7150310138504744 0.14322038530059678 0.4629578184224229 0.004485602182885184 0.07149831487989411 0.34842022979166454 0.3387696535357536 0.859356551354648 0.9715469888517128 0.8657458802140383 0.6125811047098682 0.17898798452881726 0.21757041220968598
diff --git a/tests/native/testgetobjectclass0.c b/tests/native/testgetobjectclass0.c
deleted file mode 100644 (file)
index 8d29133..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/* tests/native/testgetobjectclass0.c - tests argument passing
-
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-   TU Wien
-
-   This file is part of CACAO.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
-
-   Contact: cacao@complang.tuwien.ac.at
-
-   Authors: Joseph Wenninger
-
-   $Id: testgetobjectclass0.c 1773 2004-12-19 17:39:01Z jowenn $
-
-*/
-
-
-#include "config.h"
-#include "native/jni.h"
-
-
-JNIEXPORT void JNICALL Java_testgetobjectclass0_getobjectclass0(JNIEnv *env, jclass clazz)
-{
-    (*env)->GetObjectClass(env,0);
-}
diff --git a/tests/native/testgetobjectclass0.java b/tests/native/testgetobjectclass0.java
deleted file mode 100644 (file)
index 32e70d5..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* tests/native/testgetobjectclass0.java - tests argument passing
-
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-   TU Wien
-
-   This file is part of CACAO.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
-
-   Contact: cacao@complang.tuwien.ac.at
-
-   Authors: Joseph Wenninger
-
-   $Id: testgetobjectclass0.java 1773 2004-12-19 17:39:01Z jowenn $
-
-*/
-
-
-public class  testgetobjectclass0{
-
-    public static native void getobjectclass0();
-
-    public static void main(String[] args) {
-        System.loadLibrary("testgetobjectclass0");
-        getobjectclass0();
-    }
-}
diff --git a/tests/regression/native/.cvsignore b/tests/regression/native/.cvsignore
new file mode 100644 (file)
index 0000000..94cc1ce
--- /dev/null
@@ -0,0 +1,3 @@
+*.class
+Makefile
+Makefile.in
diff --git a/tests/regression/native/Makefile.am b/tests/regression/native/Makefile.am
new file mode 100644 (file)
index 0000000..9fb5b4b
--- /dev/null
@@ -0,0 +1,80 @@
+## src/tests/native/Makefile.am
+##
+## Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+## R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+## C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+## Institut f. Computersprachen - TU Wien
+##
+## This file is part of CACAO.
+##
+## This program is free software; you can redistribute it and/or
+## modify it under the terms of the GNU General Public License as
+## published by the Free Software Foundation; either version 2, or (at
+## your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+##
+## Contact: cacao@complang.tuwien.ac.at
+##
+## Authors: Christian Thalinger
+##
+## Changes:
+##
+## $Id: Makefile.am 4094 2006-01-08 19:14:17Z twisti $
+
+## Process this file with automake to produce Makefile.in
+
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR)
+
+CLEANFILES = \
+       libcheckjni.so \
+       checkjni.class \
+       checkjni.h \
+       \
+       libtestarguments.so \
+       testarguments.class \
+       testarguments.h
+
+JAVA = $(top_builddir)/src/cacao/cacao
+JAVAH = $(top_builddir)/src/cacaoh/cacaoh
+
+checkall: test.tst checkjni.tst testarguments.tst
+
+test:
+       $(JAVAC) test.java
+       $(JAVAH) test
+       $(CC) -shared $(INCLUDES) $(CFLAGS) test.c -o libtest.so -fPIC
+
+checkjni:
+       $(JAVAC) checkjni.java
+       $(JAVAH) checkjni
+       $(CC) -shared $(INCLUDES) $(CFLAGS) checkjni.c -o libcheckjni.so -fPIC
+
+testarguments:
+       $(JAVAC) testarguments.java
+       $(JAVAH) testarguments
+       $(CC) -shared $(INCLUDES) $(CFLAGS) testarguments.c -o libtestarguments.so -fPIC
+       $(JAVAC) testgetobjectclass0.java
+       $(JAVAH) testgetobjectclass0
+       $(CC) -shared $(INCLUDES) $(CFLAGS) testgetobjectclass0.c -o libtestgetobjectclass0.so -fPIC
+
+%.tst: %
+       sh ../Test.sh $(JAVA) $*
+       rm -f $*.thisoutput
+       rm -f $*.this2output
+
+## Local variables:
+## mode: Makefile
+## indent-tabs-mode: t
+## c-basic-offset: 4
+## tab-width: 8
+## compile-command: "automake --add-missing"
+## End:
diff --git a/tests/regression/native/checkjni.c b/tests/regression/native/checkjni.c
new file mode 100644 (file)
index 0000000..08349ef
--- /dev/null
@@ -0,0 +1,50 @@
+/* src/tests/native/checkjni.c - for testing JNI stuff
+
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   TU Wien
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+
+   Contact: cacao@complang.tuwien.ac.at
+
+   Authors: Christian Thalinger
+
+   Changes:
+
+   $Id: checkjni.c 2170 2005-03-31 19:18:38Z twisti $
+
+*/
+
+
+#include <stdio.h>
+
+#include "config.h"
+#include "native/jni.h"
+
+
+JNIEXPORT jboolean JNICALL Java_checkjni_IsAssignableFrom(JNIEnv *env, jclass clazz, jclass sub, jclass sup)
+{
+  return (*env)->IsAssignableFrom(env, sub, sup);
+}
+
+JNIEXPORT jboolean JNICALL Java_checkjni_IsInstanceOf(JNIEnv *env, jclass clazz, jobject obj, jclass c)
+{
+  return (*env)->IsInstanceOf(env, obj, c);
+}
diff --git a/tests/regression/native/checkjni.java b/tests/regression/native/checkjni.java
new file mode 100644 (file)
index 0000000..d55a1f2
--- /dev/null
@@ -0,0 +1,85 @@
+/* src/tests/native/checkjni.java - for testing JNI related stuff
+
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   TU Wien
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+
+   Contact: cacao@complang.tuwien.ac.at
+
+   Authors: Christian Thalinger
+
+   Changes:
+
+   $Id: checkjni.java 2170 2005-03-31 19:18:38Z twisti $
+
+*/
+
+
+public class checkjni {
+    public native boolean IsAssignableFrom(Class sub, Class sup);
+    public native boolean IsInstanceOf(Object obj, Class clazz);
+
+    public static void main(String[] argv) {
+        System.loadLibrary("checkjni");
+
+        new checkjni();
+    }
+
+    public checkjni() {
+        checkIsAssignableFrom();
+        checkIsInstanceOf();
+    }
+
+    void checkIsAssignableFrom() {
+        p("IsAssignableFrom:");
+
+        Class sub = Integer.class;
+        Class sup = Object.class;
+
+        equal(IsAssignableFrom(sup, sup), true);
+        equal(IsAssignableFrom(sub, sup), true);
+        equal(IsAssignableFrom(sup, sub), false);
+    }
+
+    void checkIsInstanceOf() {
+        p("IsInstanceOf:");
+
+        Object obj = new Object();
+        Object obj2 = new Integer(1);
+        Class clazz = Object.class;
+        Class clazz2 = Integer.class;
+
+        equal(IsInstanceOf(obj, clazz), true);
+        equal(IsInstanceOf(obj2, clazz), true);
+        equal(IsInstanceOf(obj, clazz2), false);
+    }
+
+    void equal(boolean a, boolean b) {
+        if (a == b)
+            p("PASS");
+        else
+            p("FAILED");
+    }
+
+    void p(String s) {
+        System.out.println(s);
+    }
+}
diff --git a/tests/regression/native/checkjni.output b/tests/regression/native/checkjni.output
new file mode 100644 (file)
index 0000000..04f17d8
--- /dev/null
@@ -0,0 +1,8 @@
+IsAssignableFrom:
+PASS
+PASS
+PASS
+IsInstanceOf:
+PASS
+PASS
+PASS
diff --git a/tests/regression/native/test.c b/tests/regression/native/test.c
new file mode 100644 (file)
index 0000000..fc99f30
--- /dev/null
@@ -0,0 +1,44 @@
+/* tests/native/test.c - for testing native stuff
+
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   TU Wien
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+
+   Contact: cacao@complang.tuwien.ac.at
+
+   Authors: Christian Thalinger
+
+   $Id: test.c 1899 2005-02-08 13:43:33Z twisti $
+
+*/
+
+
+#include <stdio.h>
+
+#include "config.h"
+#include "native/jni.h"
+
+
+JNIEXPORT void JNICALL Java_test_nsub(JNIEnv *env, jclass clazz)
+{
+    jint version = (*env)->GetVersion(env);
+    printf("JNI Version: %d\n", version);
+}
diff --git a/tests/regression/native/test.java b/tests/regression/native/test.java
new file mode 100644 (file)
index 0000000..33958c2
--- /dev/null
@@ -0,0 +1,41 @@
+/* tests/native/test.java - file for testing native related stuff
+
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   TU Wien
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+
+   Contact: cacao@complang.tuwien.ac.at
+
+   Authors: Christian Thalinger
+
+   $Id: test.java 1899 2005-02-08 13:43:33Z twisti $
+
+*/
+
+
+public class test {
+    public static native void nsub();
+
+    public static void main(String[] argv) {
+        System.loadLibrary("test");
+        nsub();
+    }
+}
diff --git a/tests/regression/native/test.output b/tests/regression/native/test.output
new file mode 100644 (file)
index 0000000..0cac2af
--- /dev/null
@@ -0,0 +1 @@
+JNI Version: 65540
diff --git a/tests/regression/native/testarguments.c b/tests/regression/native/testarguments.c
new file mode 100644 (file)
index 0000000..8752f32
--- /dev/null
@@ -0,0 +1,175 @@
+/* tests/native/testarguments.c - tests argument passing
+
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   TU Wien
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+
+   Contact: cacao@complang.tuwien.ac.at
+
+   Authors: Christian Thalinger
+
+   $Id: testarguments.c 3522 2005-10-28 18:07:00Z twisti $
+
+*/
+
+
+#include <stdio.h>
+
+#include "config.h"
+#include "native/jni.h"
+
+
+JNIEXPORT void JNICALL Java_testarguments_nisub(JNIEnv *env, jclass clazz, jint a, jint b, jint c, jint d, jint e, jint f, jint g, jint h, jint i, jint j, jint k, jint l, jint m, jint n, jint o)
+{
+    jmethodID mid;
+
+    printf("java-native: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
+    fflush(stdout);
+
+    mid = (*env)->GetStaticMethodID(env, clazz, "jisub", "(IIIIIIIIIIIIIII)V");
+
+    if (mid == 0) {
+        printf("native: couldn't find jisub\n");
+        return;
+    }
+
+    (*env)->CallStaticVoidMethod(env, clazz, mid, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
+}
+
+
+JNIEXPORT void JNICALL Java_testarguments_nlsub(JNIEnv *env, jclass clazz, jlong a, jlong b, jlong c, jlong d, jlong e, jlong f, jlong g, jlong h, jlong i, jlong j, jlong k, jlong l, jlong m, jlong n, jlong o)
+{
+    jmethodID mid;
+
+#if SIZEOF_VOID_P == 4
+    printf("java-native: 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx\n", a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
+#else
+    printf("java-native: 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n", a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
+#endif
+    fflush(stdout);
+
+    mid = (*env)->GetStaticMethodID(env, clazz, "jlsub", "(JJJJJJJJJJJJJJJ)V");
+
+    if (mid == 0) {
+        printf("native: couldn't find jlsub\n");
+        return;
+    }
+
+    (*env)->CallStaticVoidMethod(env, clazz, mid, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
+}
+
+
+JNIEXPORT void JNICALL Java_testarguments_nfsub(JNIEnv *env, jclass clazz, jfloat a, jfloat b, jfloat c, jfloat d, jfloat e, jfloat f, jfloat g, jfloat h, jfloat i, jfloat j, jfloat k, jfloat l, jfloat m, jfloat n, jfloat o)
+{
+    jmethodID mid;
+    union {
+      jint i;
+      jfloat f;
+    } x;
+
+    printf("java-native:");
+
+    x.f = a; printf(" 0x%x", x.i);
+    x.f = b; printf(" 0x%x", x.i);
+    x.f = c; printf(" 0x%x", x.i);
+    x.f = d; printf(" 0x%x", x.i);
+    x.f = e; printf(" 0x%x", x.i);
+    x.f = f; printf(" 0x%x", x.i);
+    x.f = g; printf(" 0x%x", x.i);
+    x.f = h; printf(" 0x%x", x.i);
+    x.f = i; printf(" 0x%x", x.i);
+    x.f = j; printf(" 0x%x", x.i);
+    x.f = k; printf(" 0x%x", x.i);
+    x.f = l; printf(" 0x%x", x.i);
+    x.f = m; printf(" 0x%x", x.i);
+    x.f = n; printf(" 0x%x", x.i);
+    x.f = o; printf(" 0x%x", x.i);
+
+    printf("\n");
+    fflush(stdout);
+
+    mid = (*env)->GetStaticMethodID(env, clazz, "jfsub", "(FFFFFFFFFFFFFFF)V");
+
+    if (mid == 0) {
+        printf("native: couldn't find jfsub\n");
+        return;
+    }
+
+    (*env)->CallStaticVoidMethod(env, clazz, mid, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
+}
+
+
+JNIEXPORT void JNICALL Java_testarguments_ndsub(JNIEnv *env, jclass clazz, jdouble a, jdouble b, jdouble c, jdouble d, jdouble e, jdouble f, jdouble g, jdouble h, jdouble i, jdouble j, jdouble k, jdouble l, jdouble m, jdouble n, jdouble o)
+{
+    jmethodID mid;
+    union {
+      jlong l;
+      jdouble d;
+    } x;
+
+    printf("java-native:");
+
+#if SIZEOF_VOID_P == 4
+    x.d = a; printf(" 0x%llx", x.l);
+    x.d = b; printf(" 0x%llx", x.l);
+    x.d = c; printf(" 0x%llx", x.l);
+    x.d = d; printf(" 0x%llx", x.l);
+    x.d = e; printf(" 0x%llx", x.l);
+    x.d = f; printf(" 0x%llx", x.l);
+    x.d = g; printf(" 0x%llx", x.l);
+    x.d = h; printf(" 0x%llx", x.l);
+    x.d = i; printf(" 0x%llx", x.l);
+    x.d = j; printf(" 0x%llx", x.l);
+    x.d = k; printf(" 0x%llx", x.l);
+    x.d = l; printf(" 0x%llx", x.l);
+    x.d = m; printf(" 0x%llx", x.l);
+    x.d = n; printf(" 0x%llx", x.l);
+    x.d = o; printf(" 0x%llx", x.l);
+#else
+    x.d = a; printf(" 0x%lx", x.l);
+    x.d = b; printf(" 0x%lx", x.l);
+    x.d = c; printf(" 0x%lx", x.l);
+    x.d = d; printf(" 0x%lx", x.l);
+    x.d = e; printf(" 0x%lx", x.l);
+    x.d = f; printf(" 0x%lx", x.l);
+    x.d = g; printf(" 0x%lx", x.l);
+    x.d = h; printf(" 0x%lx", x.l);
+    x.d = i; printf(" 0x%lx", x.l);
+    x.d = j; printf(" 0x%lx", x.l);
+    x.d = k; printf(" 0x%lx", x.l);
+    x.d = l; printf(" 0x%lx", x.l);
+    x.d = m; printf(" 0x%lx", x.l);
+    x.d = n; printf(" 0x%lx", x.l);
+    x.d = o; printf(" 0x%lx", x.l);
+#endif
+
+    printf("\n");
+    fflush(stdout);
+
+    mid = (*env)->GetStaticMethodID(env, clazz, "jdsub", "(DDDDDDDDDDDDDDD)V");
+
+    if (mid == 0) {
+        printf("native: couldn't find jfsub\n");
+        return;
+    }
+
+    (*env)->CallStaticVoidMethod(env, clazz, mid, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
+}
diff --git a/tests/regression/native/testarguments.java b/tests/regression/native/testarguments.java
new file mode 100644 (file)
index 0000000..1dcdee5
--- /dev/null
@@ -0,0 +1,251 @@
+/* tests/native/testarguments.java - tests argument passing
+
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   TU Wien
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+
+   Contact: cacao@complang.tuwien.ac.at
+
+   Authors: Christian Thalinger
+
+   $Id: testarguments.java 3523 2005-10-28 19:56:29Z twisti $
+
+*/
+
+
+import java.util.*;
+
+public class testarguments {
+    static Random r;
+
+    public static native void nisub(int a, int b, int c, int d, int e,
+                                    int f, int g, int h, int i, int j,
+                                    int k, int l, int m, int n, int o);
+
+    public static native void nlsub(long a, long b, long c, long d, long e,
+                                    long f, long g, long h, long i, long j,
+                                    long k, long l, long m, long n, long o);
+
+    public static native void nfsub(float a, float b, float c, float d, float e,
+                                    float f, float g, float h, float i, float j,
+                                    float k, float l, float m, float n, float o);
+
+    public static native void ndsub(double a, double b, double c, double d, double e,
+                                    double f, double g, double h, double i, double j,
+                                    double k, double l, double m, double n, double o);
+
+    public static void main(String[] argv) {
+        r = new Random(0);
+
+        System.loadLibrary("testarguments");
+
+        itest();
+        ltest();
+        ftest();
+        dtest();
+    }
+
+    static void itest() {
+        pln("testing int --------------------------------------------------");
+
+        isub(0x11111111, 0x22222222, 0x33333333, 0x44444444, 0x55555555,
+             0x66666666, 0x77777777, 0x88888888, 0x99999999, 0xaaaaaaaa,
+             0xbbbbbbbb, 0xcccccccc, 0xdddddddd, 0xeeeeeeee, 0xffffffff);
+
+        pln();
+    }
+
+    static void ltest() {
+        pln("testing long -------------------------------------------------");
+
+        lsub(0x1111111111111111L, 0x2222222222222222L, 0x3333333333333333L,
+             0x4444444444444444L, 0x5555555555555555L, 0x6666666666666666L,
+             0x7777777777777777L, 0x8888888888888888L, 0x9999999999999999L,
+             0xaaaaaaaaaaaaaaaaL, 0xbbbbbbbbbbbbbbbbL, 0xccccccccccccccccL,
+             0xddddddddddddddddL, 0xeeeeeeeeeeeeeeeeL, 0xffffffffffffffffL);
+
+        pln();
+    }
+
+    static void ftest() {
+        pln("testing float ------------------------------------------------");
+
+        fsub(i2f(0x11111111), i2f(0x22222222), i2f(0x33333333),
+             i2f(0x44444444), i2f(0x55555555), i2f(0x66666666),
+             i2f(0x77777777), i2f(0x88888888), i2f(0x99999999),
+             i2f(0xaaaaaaaa), i2f(0xbbbbbbbb), i2f(0xcccccccc),
+             i2f(0xdddddddd), i2f(0xeeeeeeee), i2f(0xffffffff));
+
+        pln();
+    }
+
+    static void dtest() {
+        pln("testing double -----------------------------------------------");
+
+        dsub(l2d(0x1111111111111111L), l2d(0x2222222222222222L),
+             l2d(0x3333333333333333L), l2d(0x4444444444444444L),
+             l2d(0x5555555555555555L), l2d(0x6666666666666666L),
+             l2d(0x7777777777777777L), l2d(0x8888888888888888L),
+             l2d(0x9999999999999999L), l2d(0xaaaaaaaaaaaaaaaaL),
+             l2d(0xbbbbbbbbbbbbbbbbL), l2d(0xccccccccccccccccL),
+             l2d(0xddddddddddddddddL), l2d(0xeeeeeeeeeeeeeeeeL),
+             l2d(0xffffffffffffffffL));
+    }
+
+
+    // test java-java argument passing
+
+    public static void isub(int a, int b, int c, int d, int e,
+                            int f, int g, int h, int i, int j,
+                            int k, int l, int m, int n, int o) {
+        p("java-java  :");
+
+        p(a); p(b); p(c); p(d); p(e);
+        p(f); p(g); p(h); p(i); p(j);
+        p(k); p(l); p(m); p(n); p(o);
+
+        pln();
+
+        nisub(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
+    }
+
+    public static void lsub(long a, long b, long c, long d, long e,
+                            long f, long g, long h, long i, long j,
+                            long k, long l, long m, long n, long o) {
+        p("java-java  :");
+
+        p(a); p(b); p(c); p(d); p(e);
+        p(f); p(g); p(h); p(i); p(j);
+        p(k); p(l); p(m); p(n); p(o);
+
+        pln();
+
+        nlsub(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
+    }
+
+    public static void fsub(float a, float b, float c, float d, float e,
+                            float f, float g, float h, float i, float j,
+                            float k, float l, float m, float n, float o) {
+        p("java-java  :");
+
+        p(a); p(b); p(c); p(d); p(e);
+        p(f); p(g); p(h); p(i); p(j);
+        p(k); p(l); p(m); p(n); p(o);
+
+        pln();
+
+        nfsub(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
+    }
+
+    public static void dsub(double a, double b, double c, double d, double e,
+                            double f, double g, double h, double i, double j,
+                            double k, double l, double m, double n, double o) {
+        p("java-java  :");
+
+        p(a); p(b); p(c); p(d); p(e);
+        p(f); p(g); p(h); p(i); p(j);
+        p(k); p(l); p(m); p(n); p(o);
+
+        pln();
+
+        ndsub(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
+    }
+
+
+    // test native-java argument passing
+
+    public static void jisub(int a, int b, int c, int d, int e,
+                             int f, int g, int h, int i, int j,
+                             int k, int l, int m, int n, int o) {
+        p("native-java:");
+
+        p(a); p(b); p(c); p(d); p(e);
+        p(f); p(g); p(h); p(i); p(j);
+        p(k); p(l); p(m); p(n); p(o);
+
+        pln();
+    }
+
+    public static void jlsub(long a, long b, long c, long d, long e,
+                             long f, long g, long h, long i, long j,
+                             long k, long l, long m, long n, long o) {
+        p("native-java:");
+
+        p(a); p(b); p(c); p(d); p(e);
+        p(f); p(g); p(h); p(i); p(j);
+        p(k); p(l); p(m); p(n); p(o);
+
+        pln();
+    }
+
+    public static void jfsub(float a, float b, float c, float d, float e,
+                             float f, float g, float h, float i, float j,
+                             float k, float l, float m, float n, float o) {
+        p("native-java:");
+
+        p(a); p(b); p(c); p(d); p(e);
+        p(f); p(g); p(h); p(i); p(j);
+        p(k); p(l); p(m); p(n); p(o);
+
+        pln();
+    }
+
+    public static void jdsub(double a, double b, double c, double d, double e,
+                             double f, double g, double h, double i, double j,
+                             double k, double l, double m, double n, double o) {
+        p("native-java:");
+
+        p(a); p(b); p(c); p(d); p(e);
+        p(f); p(g); p(h); p(i); p(j);
+        p(k); p(l); p(m); p(n); p(o);
+
+        pln();
+    }
+
+    static float i2f(int i) {
+        return Float.intBitsToFloat(i);
+    }
+
+    static double l2d(long l) {
+        return Double.longBitsToDouble(l);
+    }
+
+    static void p(String s) { System.out.print(s); }
+
+    static void p(int i) {
+        System.out.print(" 0x" + Integer.toHexString(i));
+    }
+
+    static void p(long l) {
+        System.out.print(" 0x" + Long.toHexString(l));
+    }
+
+    static void p(float f) {
+        p(Float.floatToIntBits(f));
+    }
+
+    static void p(double d) {
+        p(Double.doubleToLongBits(d));
+    }
+
+    static void pln() { System.out.println(); }
+    static void pln(String s) { System.out.println(s); }
+}
diff --git a/tests/regression/native/testarguments.output b/tests/regression/native/testarguments.output
new file mode 100644 (file)
index 0000000..7ecb9f2
--- /dev/null
@@ -0,0 +1,19 @@
+testing int --------------------------------------------------
+java-java  : -1155484576 -723955400 1033096058 -1690734402 -1557280266 1327362106 -1930858313 502539523 -1728529858 -938301587 1431162155 1085665355 1654374947 -1661998771 -65105105
+java-native: -1155484576 -723955400 1033096058 -1690734402 -1557280266 1327362106 -1930858313 502539523 -1728529858 -938301587 1431162155 1085665355 1654374947 -1661998771 -65105105
+native-java: -1155484576 -723955400 1033096058 -1690734402 -1557280266 1327362106 -1930858313 502539523 -1728529858 -938301587 1431162155 1085665355 1654374947 -1661998771 -65105105
+
+testing long -------------------------------------------------
+java-java  : -316923953663567096 425784808157066482 3246199166113899023 5772649832669734744 6787954838522539928 -5438565800896958689 25579809655956232 170168523965373507 -8062155292093192501 4664870386390374308 5274012497411174555 275355961613117157 -429849028627267071 -5751058041584006506 -2440897930508784356
+java-native: -316923953663567096 425784808157066482 3246199166113899023 5772649832669734744 6787954838522539928 -5438565800896958689 25579809655956232 170168523965373507 -8062155292093192501 4664870386390374308 5274012497411174555 275355961613117157 -429849028627267071 -5751058041584006506 -2440897930508784356
+native-java: -316923953663567096 425784808157066482 3246199166113899023 5772649832669734744 6787954838522539928 -5438565800896958689 25579809655956232 170168523965373507 -8062155292093192501 4664870386390374308 5274012497411174555 275355961613117157 -429849028627267071 -5751058041584006506 -2440897930508784356
+
+testing float ------------------------------------------------
+java-java  : 0.9809451 0.73315203 0.57003427 0.81729704 0.012806594 0.8388903 0.41221774 0.5266994 0.7257748 0.89933497 0.9846741 0.1339398 0.5461274 0.08306235 0.18598962
+java-native: 0.98094511 0.73315203 0.57003427 0.81729704 0.01280659 0.83889031 0.41221774 0.52669942 0.72577482 0.89933497 0.98467410 0.13393980 0.54612738 0.08306235 0.18598962
+native-java: 0.9809451 0.73315203 0.57003427 0.81729704 0.012806594 0.8388903 0.41221774 0.5266994 0.7257748 0.89933497 0.9846741 0.1339398 0.5461274 0.08306235 0.18598962
+
+testing double -----------------------------------------------
+java-java  : 0.9785743401478403 0.7223571191888487 0.7150310138504744 0.14322038530059678 0.4629578184224229 0.004485602182885184 0.07149831487989411 0.34842022979166454 0.3387696535357536 0.859356551354648 0.9715469888517128 0.8657458802140383 0.6125811047098682 0.17898798452881726 0.21757041220968598
+java-native: 0.9785743401478403 0.7223571191888487 0.7150310138504744 0.1432203853005968 0.4629578184224229 0.004485602182885184 0.07149831487989411 0.3484202297916645 0.3387696535357536 0.8593565513546479 0.9715469888517128 0.8657458802140383 0.6125811047098682 0.1789879845288173 0.217570412209686
+native-java: 0.9785743401478403 0.7223571191888487 0.7150310138504744 0.14322038530059678 0.4629578184224229 0.004485602182885184 0.07149831487989411 0.34842022979166454 0.3387696535357536 0.859356551354648 0.9715469888517128 0.8657458802140383 0.6125811047098682 0.17898798452881726 0.21757041220968598
diff --git a/tests/regression/native/testgetobjectclass0.c b/tests/regression/native/testgetobjectclass0.c
new file mode 100644 (file)
index 0000000..8d29133
--- /dev/null
@@ -0,0 +1,41 @@
+/* tests/native/testgetobjectclass0.c - tests argument passing
+
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   TU Wien
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+
+   Contact: cacao@complang.tuwien.ac.at
+
+   Authors: Joseph Wenninger
+
+   $Id: testgetobjectclass0.c 1773 2004-12-19 17:39:01Z jowenn $
+
+*/
+
+
+#include "config.h"
+#include "native/jni.h"
+
+
+JNIEXPORT void JNICALL Java_testgetobjectclass0_getobjectclass0(JNIEnv *env, jclass clazz)
+{
+    (*env)->GetObjectClass(env,0);
+}
diff --git a/tests/regression/native/testgetobjectclass0.java b/tests/regression/native/testgetobjectclass0.java
new file mode 100644 (file)
index 0000000..32e70d5
--- /dev/null
@@ -0,0 +1,42 @@
+/* tests/native/testgetobjectclass0.java - tests argument passing
+
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   TU Wien
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+
+   Contact: cacao@complang.tuwien.ac.at
+
+   Authors: Joseph Wenninger
+
+   $Id: testgetobjectclass0.java 1773 2004-12-19 17:39:01Z jowenn $
+
+*/
+
+
+public class  testgetobjectclass0{
+
+    public static native void getobjectclass0();
+
+    public static void main(String[] args) {
+        System.loadLibrary("testgetobjectclass0");
+        getobjectclass0();
+    }
+}