Skip to content

Commit 3579c75

Browse files
committed
8373876: StackWalkNativeToJava print more output in case of failures
Reviewed-by: dholmes, mdoerr
1 parent 9435d5b commit 3579c75

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/hotspot/jtreg/runtime/ErrorHandling/StackWalkNativeToJava.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ public static void testStackWalkNativeToJavaNative(String... extraFlags) throws
7070
output.shouldNotContain("java.lang.RuntimeException: Reached statement after obj.wait()");
7171
output.shouldNotContain("[error occurred during error reporting (printing native stack");
7272
String[] res = output.getOutput().split("StackWalkNativeToJava\\$TestNativeToJavaNative\\.callNativeMethod\\(\\)V");
73-
assertTrue(res.length - 1 == 2, res.length - 1);
73+
if (res.length != 3) {
74+
output.reportDiagnosticSummary();
75+
}
76+
77+
assertTrue(res.length == 3, res.length);
7478
output.shouldNotHaveExitValue(0);
7579
}
7680

@@ -104,7 +108,11 @@ public static void testStackWalkNativeToJava(String... extraFlags) throws Except
104108
output.shouldNotContain("java.lang.RuntimeException: Reached statement after synchronized");
105109
output.shouldNotContain("[error occurred during error reporting (printing native stack");
106110
String[] res = output.getOutput().split("StackWalkNativeToJava\\$TestNativeToJava\\.callVMMethod\\(\\)V");
107-
assertTrue(res.length - 1 == 2, res.length - 1);
111+
if (res.length != 3) {
112+
output.reportDiagnosticSummary();
113+
}
114+
115+
assertTrue(res.length == 3, res.length);
108116
output.shouldNotHaveExitValue(0);
109117
}
110118

@@ -131,4 +139,4 @@ private static void assertTrue(boolean condition, int count) {
131139
throw new RuntimeException("Count error: count was " + count);
132140
}
133141
}
134-
}
142+
}

0 commit comments

Comments
 (0)