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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.jni/] [bytebuffer.c] - Blame information for rev 776

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

Line No. Rev Author Line
1 765 jeremybenn
#include "bytebuffer.h"
2
 
3
static void
4
test_buffer (JNIEnv *env, jobject buffer, const char *name)
5
{
6
  void *tmp = (*env)->GetDirectBufferAddress (env, buffer);
7
 
8
  if (tmp == NULL)
9
    printf ("PASS: address of %s\n", name);
10
  else
11
    printf ("FAIL: address of %s\n", name);
12
 
13
  int tmplen = (*env)->GetDirectBufferCapacity (env, buffer);
14
 
15
  if (tmplen == -1)
16
    printf ("PASS: length of %s\n", name);
17
  else
18
    printf ("FAIL: length of %s\n", name);
19
}
20
 
21
JNIEXPORT void JNICALL
22
Java_bytebuffer_testByteBuffer (JNIEnv *env, jclass k, jobject buffer)
23
{
24
  test_buffer (env, buffer, "java.nio.ByteBuffer");
25
}
26
 
27
JNIEXPORT void JNICALL
28
Java_bytebuffer_testCharBuffer (JNIEnv *env, jclass k, jobject buffer)
29
{
30
  test_buffer (env, buffer, "java.nio.CharBuffer");
31
}
32
 
33
JNIEXPORT void JNICALL
34
Java_bytebuffer_testDoubleBuffer (JNIEnv *env, jclass k, jobject buffer)
35
{
36
  test_buffer (env, buffer, "java.nio.DoubleBuffer");
37
}
38
 
39
JNIEXPORT void JNICALL
40
Java_bytebuffer_testFloatBuffer (JNIEnv *env, jclass k, jobject buffer)
41
{
42
  test_buffer (env, buffer, "java.nio.FloatBuffer");
43
}
44
 
45
JNIEXPORT void JNICALL
46
Java_bytebuffer_testIntBuffer (JNIEnv *env, jclass k, jobject buffer)
47
{
48
  test_buffer (env, buffer, "java.nio.IntBuffer");
49
}
50
 
51
JNIEXPORT void JNICALL
52
Java_bytebuffer_testLongBuffer (JNIEnv *env, jclass k, jobject buffer)
53
{
54
  test_buffer (env, buffer, "java.nio.LongBuffer");
55
}
56
 
57
JNIEXPORT void JNICALL
58
Java_bytebuffer_testShortBuffer (JNIEnv *env, jclass k, jobject buffer)
59
{
60
  test_buffer (env, buffer, "java.nio.ShortBuffer");
61
}
62
 

powered by: WebSVN 2.1.0

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