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) {
test();
} else {
OutputAnalyzer output =
ProcessTools.executeTestJvm("-Xcheck:jni",
"-Djava.library.path=" + Utils.TEST_NATIVE_PATH,
"TestCheckedReleaseArrayElements");
// Uses executeProcess() instead of executeTestJvm() to avoid passing options
// that might generate output on stderr (which should be empty for this test).
ProcessBuilder pb =
ProcessTools.createJavaProcessBuilder("-Xcheck:jni",
"-Djava.library.path=" + Utils.TEST_NATIVE_PATH,
"TestCheckedReleaseArrayElements");
OutputAnalyzer output = ProcessTools.executeProcess(pb);
output.shouldHaveExitValue(0);
output.stderrShouldBeEmpty();
output.stdoutShouldNotBeEmpty();