virtual.java: New file.

* libjava.jni/virtual.java: New file.
	* libjava.jni/virtual.c: New file.
	* libjava.jni/virtual.out: New file.
	* libjava.jni/final_method.java: New file.
	* libjava.jni/final_method.c: New file.
	* libjava.jni/final_method.out: New file.
	* libjava.jni/overload.java: New file.
	* libjava.jni/overload.c: New file.
	* libjava.jni/overload.out: New file.
	* libjava.jni/simple_int.java: New file.
	* libjava.jni/simple_int.c: New file.
	* libjava.jni/simple_int.out: New file.
	* libjava.jni/invoke.out: New file.
	* libjava.jni/invoke.c: New file.
	* libjava.jni/invoke.java: New file.

From-SVN: r31996
This commit is contained in:
Tom Tromey 2000-02-16 00:19:55 +00:00 committed by Tom Tromey
parent d348bda453
commit 73d7c68909
16 changed files with 156 additions and 0 deletions

View File

@ -1,3 +1,21 @@
2000-02-15 Tom Tromey <tromey@cygnus.com>
* libjava.jni/virtual.java: New file.
* libjava.jni/virtual.c: New file.
* libjava.jni/virtual.out: New file.
* libjava.jni/final_method.java: New file.
* libjava.jni/final_method.c: New file.
* libjava.jni/final_method.out: New file.
* libjava.jni/overload.java: New file.
* libjava.jni/overload.c: New file.
* libjava.jni/overload.out: New file.
* libjava.jni/simple_int.java: New file.
* libjava.jni/simple_int.c: New file.
* libjava.jni/simple_int.out: New file.
* libjava.jni/invoke.out: New file.
* libjava.jni/invoke.c: New file.
* libjava.jni/invoke.java: New file.
2000-02-12 Anthony Green <green@cygnus.com>
* libjava.compile/comment.java: New file.

View File

@ -0,0 +1,7 @@
#include <final_method.h>
jstring
Java_final_1method_meth (JNIEnv *env, jobject thisv)
{
return (*env)->NewStringUTF (env, "zardoz has spoken");
}

View File

@ -0,0 +1,17 @@
// Minimal test a non-static final method.
public class final_method
{
static
{
System.loadLibrary ("final_method");
}
public final native String meth ();
public static void main (String[] args)
{
final_method fm = new final_method ();
System.out.println (fm.meth ());
}
}

View File

@ -0,0 +1 @@
zardoz has spoken

View File

@ -0,0 +1,7 @@
#include <invoke.h>
jint
Java_invoke_val (JNIEnv *env, jclass klass)
{
return 23;
}

View File

@ -0,0 +1,18 @@
// Test to make sure the minimal invocation works.
public class invoke
{
public static native int val ();
static
{
System.out.println ("trying...");
System.loadLibrary ("invoke");
System.out.println ("loaded");
}
public static void main (String[] args)
{
System.out.println (val ());
}
}

View File

@ -0,0 +1,3 @@
trying...
loaded
23

View File

@ -0,0 +1,16 @@
#include <overload.h>
jint
Java_overload_over__I (JNIEnv *env, jclass klass, jint val)
{
return val;
}
jint
Java_overload_over__II (JNIEnv *env, jclass klass, jint one, jint two)
{
return one + two;
}

View File

@ -0,0 +1,18 @@
// Test to make sure overloaded functions with long names work.
public class overload
{
static
{
System.loadLibrary ("overload");
}
public static native int over (int one);
public static native int over (int one, int two);
public static void main (String[] args)
{
System.out.println (over (1));
System.out.println (over (1, 2));
}
}

View File

@ -0,0 +1,2 @@
1
3

View File

@ -0,0 +1,7 @@
#include <simple_int.h>
jint
Java_simple_1int_nat (JNIEnv *env, jclass klass, jint val)
{
return 2 * val;
}

View File

@ -0,0 +1,16 @@
// Test a simple static function with an `int' argument.
public class simple_int
{
public static native int nat (int z);
static
{
System.loadLibrary ("simple_int");
}
public static void main (String[] args)
{
System.out.println (nat (23));
}
}

View File

@ -0,0 +1 @@
46

View File

@ -0,0 +1,7 @@
#include <virtual.h>
jboolean
Java_virtual_equals (JNIEnv *env, jobject thisv, jobject other)
{
return JNI_FALSE;
}

View File

@ -0,0 +1,17 @@
// Minimal test of a virtual method.
public class virtual
{
static
{
System.loadLibrary ("virtual");
}
public native boolean equals (Object obj);
public static void main (String[] args)
{
Object v = new virtual ();
System.out.println (v.equals (v));
}
}

View File

@ -0,0 +1 @@
false