< prev index next >
test/gc/shenandoah/jni/libTestCriticalNative.c
Print this page
rev 10790 : [backport] Prefix Shenandoah tests with "Test"
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2018, Red Hat, Inc. and/or its affiliates.
+ * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
@@ -21,22 +21,22 @@
*
*/
#include "jni.h"
-JNIEXPORT jlong JNICALL JavaCritical_CriticalNativeStress_sum1
+JNIEXPORT jlong JNICALL JavaCritical_TestCriticalNativeStress_sum1
(jint length, jlong* a) {
jlong sum = 0;
jint index;
for (index = 0; index < length; index ++) {
sum += a[index];
}
return sum;
}
-JNIEXPORT jlong JNICALL JavaCritical_CriticalNativeStress_sum2
+JNIEXPORT jlong JNICALL JavaCritical_TestCriticalNativeStress_sum2
(jlong a1, jint a2_length, jint* a2, jint a4_length, jint* a4, jint a6_length, jlong* a6, jint a8_length, jint* a8) {
jlong sum = a1;
jint index;
for (index = 0; index < a2_length; index ++) {
sum += a2[index];
@@ -54,11 +54,11 @@
sum += a8[index];
}
return sum;
}
-JNIEXPORT jlong JNICALL Java_CriticalNativeStress_sum1
+JNIEXPORT jlong JNICALL Java_TestCriticalNativeStress_sum1
(JNIEnv *env, jclass jclazz, jlongArray a) {
jlong sum = 0;
jsize len = (*env)->GetArrayLength(env, a);
jsize index;
jlong* arr = (jlong*)(*env)->GetPrimitiveArrayCritical(env, a, 0);
@@ -68,11 +68,11 @@
(*env)->ReleasePrimitiveArrayCritical(env, a, arr, 0);
return sum;
}
-JNIEXPORT jlong JNICALL Java_CriticalNativeStress_sum2
+JNIEXPORT jlong JNICALL Java_TestCriticalNativeStress_sum2
(JNIEnv *env, jclass jclazz, jlong a1, jintArray a2, jintArray a3, jlongArray a4, jintArray a5) {
jlong sum = a1;
jsize index;
jsize len = (*env)->GetArrayLength(env, a2);
jint* a2_arr = (jint*)(*env)->GetPrimitiveArrayCritical(env, a2, 0);
@@ -86,11 +86,10 @@
for (index = 0; index < len; index ++) {
sum += a3_arr[index];
}
(*env)->ReleasePrimitiveArrayCritical(env, a3, a3_arr, 0);
-
len = (*env)->GetArrayLength(env, a4);
jlong* a4_arr = (jlong*)(*env)->GetPrimitiveArrayCritical(env, a4, 0);
for (index = 0; index < len; index ++) {
sum += a4_arr[index];
}
@@ -104,21 +103,19 @@
(*env)->ReleasePrimitiveArrayCritical(env, a5, a5_arr, 0);
return sum;
}
-
-JNIEXPORT jboolean JNICALL JavaCritical_CriticalNativeArgs_isNull
+JNIEXPORT jboolean JNICALL JavaCritical_TestCriticalNativeArgs_isNull
(jint length, jint* a) {
return (a == NULL) && (length == 0);
}
-JNIEXPORT jboolean JNICALL Java_CriticalNativeArgs_isNull
+JNIEXPORT jboolean JNICALL Java_TestCriticalNativeArgs_isNull
(JNIEnv *env, jclass jclazz, jintArray a) {
jboolean is_null;
jsize len = (*env)->GetArrayLength(env, a);
jint* arr = (jint*)(*env)->GetPrimitiveArrayCritical(env, a, 0);
is_null = (arr == NULL) && (len == 0);
(*env)->ReleasePrimitiveArrayCritical(env, a, arr, 0);
return is_null;
}
-
< prev index next >