Dead
[official-gcc.git] / gomp-20050608-branch / libjava / testsuite / libjava.jni / bytebuffer.java
blob0e541123f55c7965dc07d5c107a3f566c76836bb
1 // Test to make sure JNI implementation catches exceptions.
3 import java.nio.*;
5 public class bytebuffer
7 static
9 System.loadLibrary("bytebuffer");
12 public static native void testByteBuffer(ByteBuffer bb);
13 public static native void testCharBuffer(CharBuffer b);
14 public static native void testDoubleBuffer(DoubleBuffer b);
15 public static native void testFloatBuffer(FloatBuffer b);
16 public static native void testIntBuffer(IntBuffer b);
17 public static native void testLongBuffer(LongBuffer b);
18 public static native void testShortBuffer(ShortBuffer b);
20 public static void main(String[] args)
22 ByteBuffer bb = ByteBuffer.allocate(1024);
23 testByteBuffer(bb);
24 testCharBuffer(bb.asCharBuffer());
25 testDoubleBuffer(bb.asDoubleBuffer());
26 testFloatBuffer(bb.asFloatBuffer());
27 testIntBuffer(bb.asIntBuffer());
28 testLongBuffer(bb.asLongBuffer());
29 testShortBuffer(bb.asShortBuffer());
31 testCharBuffer(CharBuffer.allocate(1024));
32 testDoubleBuffer(DoubleBuffer.allocate(1024));
33 testFloatBuffer(FloatBuffer.allocate(1024));
34 testIntBuffer(IntBuffer.allocate(1024));
35 testLongBuffer(LongBuffer.allocate(1024));
36 testShortBuffer(ShortBuffer.allocate(1024));