mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-05 01:34:12 +08:00
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:
parent
d348bda453
commit
73d7c68909
@ -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.
|
||||
|
7
libjava/testsuite/libjava.jni/final_method.c
Normal file
7
libjava/testsuite/libjava.jni/final_method.c
Normal 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");
|
||||
}
|
17
libjava/testsuite/libjava.jni/final_method.java
Normal file
17
libjava/testsuite/libjava.jni/final_method.java
Normal 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 ());
|
||||
}
|
||||
}
|
1
libjava/testsuite/libjava.jni/final_method.out
Normal file
1
libjava/testsuite/libjava.jni/final_method.out
Normal file
@ -0,0 +1 @@
|
||||
zardoz has spoken
|
7
libjava/testsuite/libjava.jni/invoke.c
Normal file
7
libjava/testsuite/libjava.jni/invoke.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include <invoke.h>
|
||||
|
||||
jint
|
||||
Java_invoke_val (JNIEnv *env, jclass klass)
|
||||
{
|
||||
return 23;
|
||||
}
|
18
libjava/testsuite/libjava.jni/invoke.java
Normal file
18
libjava/testsuite/libjava.jni/invoke.java
Normal 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 ());
|
||||
}
|
||||
}
|
3
libjava/testsuite/libjava.jni/invoke.out
Normal file
3
libjava/testsuite/libjava.jni/invoke.out
Normal file
@ -0,0 +1,3 @@
|
||||
trying...
|
||||
loaded
|
||||
23
|
16
libjava/testsuite/libjava.jni/overload.c
Normal file
16
libjava/testsuite/libjava.jni/overload.c
Normal 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;
|
||||
}
|
||||
|
||||
|
18
libjava/testsuite/libjava.jni/overload.java
Normal file
18
libjava/testsuite/libjava.jni/overload.java
Normal 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));
|
||||
}
|
||||
}
|
2
libjava/testsuite/libjava.jni/overload.out
Normal file
2
libjava/testsuite/libjava.jni/overload.out
Normal file
@ -0,0 +1,2 @@
|
||||
1
|
||||
3
|
7
libjava/testsuite/libjava.jni/simple_int.c
Normal file
7
libjava/testsuite/libjava.jni/simple_int.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include <simple_int.h>
|
||||
|
||||
jint
|
||||
Java_simple_1int_nat (JNIEnv *env, jclass klass, jint val)
|
||||
{
|
||||
return 2 * val;
|
||||
}
|
16
libjava/testsuite/libjava.jni/simple_int.java
Normal file
16
libjava/testsuite/libjava.jni/simple_int.java
Normal 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));
|
||||
}
|
||||
}
|
1
libjava/testsuite/libjava.jni/simple_int.out
Normal file
1
libjava/testsuite/libjava.jni/simple_int.out
Normal file
@ -0,0 +1 @@
|
||||
46
|
7
libjava/testsuite/libjava.jni/virtual.c
Normal file
7
libjava/testsuite/libjava.jni/virtual.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include <virtual.h>
|
||||
|
||||
jboolean
|
||||
Java_virtual_equals (JNIEnv *env, jobject thisv, jobject other)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
17
libjava/testsuite/libjava.jni/virtual.java
Normal file
17
libjava/testsuite/libjava.jni/virtual.java
Normal 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));
|
||||
}
|
||||
}
|
1
libjava/testsuite/libjava.jni/virtual.out
Normal file
1
libjava/testsuite/libjava.jni/virtual.out
Normal file
@ -0,0 +1 @@
|
||||
false
|
Loading…
Reference in New Issue
Block a user