OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.jni/] [directbuffer.java] - Blame information for rev 821

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
// Test to make sure JNI implementation catches exceptions.
2
 
3
import java.nio.*;
4
 
5
public class directbuffer
6
{
7
  static
8
  {
9
    System.loadLibrary("directbuffer");
10
  }
11
 
12
  public static native ByteBuffer createDirectByteBuffer();
13
 
14
  public static native void testDirectByteBuffer(ByteBuffer bb, int len);
15
  public static native void testCharBuffer(CharBuffer b, int len);
16
  public static native void testDoubleBuffer(DoubleBuffer b, int len);
17
  public static native void testFloatBuffer(FloatBuffer b, int len);
18
  public static native void testIntBuffer(IntBuffer b, int len);
19
  public static native void testLongBuffer(LongBuffer b, int len);
20
  public static native void testShortBuffer(ShortBuffer b, int len);
21
 
22
  public static void main(String[] args)
23
  {
24
    ByteBuffer bb = createDirectByteBuffer();
25
    CharBuffer cb = bb.asCharBuffer();
26
    DoubleBuffer db = bb.asDoubleBuffer();
27
    FloatBuffer fb = bb.asFloatBuffer();
28
    IntBuffer ib = bb.asIntBuffer();
29
    LongBuffer lb = bb.asLongBuffer();
30
    ShortBuffer sb = bb.asShortBuffer();
31
 
32
    testDirectByteBuffer(bb, 1024);
33
    testCharBuffer(cb, 512);
34
    testDoubleBuffer(db, 128);
35
    testFloatBuffer(fb, 256);
36
    testIntBuffer(ib, 256);
37
    testLongBuffer(lb, 128);
38
    testShortBuffer(sb, 512);
39
  }
40
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.