Skip to content

Commit 7ddabbf

Browse files
committedJul 26, 2021
8271175: runtime/jni/FindClassUtf8/FindClassUtf8.java doesn't have to be run in othervm
Reviewed-by: dholmes
1 parent 3c27f91 commit 7ddabbf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed
 

‎test/hotspot/jtreg/runtime/jni/FindClassUtf8/FindClassUtf8.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,10 @@
2525
* @bug 8166358
2626
* @summary verify that -Xcheck:jni finds a bad utf8 name for class name.
2727
* @library /test/lib
28-
* @run main/native/othervm FindClassUtf8 test
28+
* @run main/native FindClassUtf8 test
2929
*/
3030

31+
import jdk.test.lib.Utils;
3132
import jdk.test.lib.process.ProcessTools;
3233
import jdk.test.lib.process.OutputAnalyzer;
3334

@@ -42,7 +43,10 @@ public final class FindClassUtf8 {
4243
public static void main(String... args) throws Exception {
4344
if (args.length == 1) {
4445
// run java -Xcheck:jni FindClassUtf8 and check that the -Xcheck:jni message comes out.
45-
ProcessTools.executeTestJvm("-Xcheck:jni", "-XX:-CreateCoredumpOnCrash", "FindClassUtf8")
46+
ProcessTools.executeTestJvm("-Djava.library.path=" + Utils.TEST_NATIVE_PATH,
47+
"-Xcheck:jni",
48+
"-XX:-CreateCoredumpOnCrash",
49+
"FindClassUtf8")
4650
.shouldContain("JNI class name is not a valid UTF8 string")
4751
.shouldNotHaveExitValue(0); // you get a core dump from -Xcheck:jni failures
4852
} else {

0 commit comments

Comments
 (0)