Skip to content

Commit bd58dd8

Browse files
committed
8212961: [TESTBUG] vmTestbase/nsk/stress/jni/ native code cleanup
Backport-of: fde183130bc6379fe0d4624bbeaf252d0e9a15c8
1 parent 1f4fc33 commit bd58dd8

File tree

8 files changed

+656
-666
lines changed

8 files changed

+656
-666
lines changed

test/hotspot/jtreg/vmTestbase/nsk/stress/jni/jnihelper.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,11 @@ static void* c_malloc(JNIEnv* env, size_t size) {
4141
env->FatalError("Unexpected JNI Exception. TEST FAIL.");\
4242
}\
4343
}
44+
45+
// Checks return code for JNI calls that don't raise exceptions
46+
// and generate fatal error
47+
#define CHECK(jniCall) do { \
48+
if ((jniCall) != 0) { \
49+
env->FatalError("Error invoking JNI method: " #jniCall); \
50+
} \
51+
} while (0)

0 commit comments

Comments
 (0)