8259446: runtime/jni/checked/TestCheckedReleaseArrayElements.java fails with stderr not empty

Reviewed-by: dcubed
This commit is contained in:
David Holmes 2021-01-08 22:25:21 +00:00
parent 628c546bea
commit 7e6677b532

View File

@ -44,10 +44,13 @@ public class TestCheckedReleaseArrayElements {
if (args == null || args.length == 0) { if (args == null || args.length == 0) {
test(); test();
} else { } else {
OutputAnalyzer output = // Uses executeProcess() instead of executeTestJvm() to avoid passing options
ProcessTools.executeTestJvm("-Xcheck:jni", // that might generate output on stderr (which should be empty for this test).
"-Djava.library.path=" + Utils.TEST_NATIVE_PATH, ProcessBuilder pb =
"TestCheckedReleaseArrayElements"); ProcessTools.createJavaProcessBuilder("-Xcheck:jni",
"-Djava.library.path=" + Utils.TEST_NATIVE_PATH,
"TestCheckedReleaseArrayElements");
OutputAnalyzer output = ProcessTools.executeProcess(pb);
output.shouldHaveExitValue(0); output.shouldHaveExitValue(0);
output.stderrShouldBeEmpty(); output.stderrShouldBeEmpty();
output.stdoutShouldNotBeEmpty(); output.stdoutShouldNotBeEmpty();