mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-11803 added 'main', simplified code for easier debugging
X-SVN-Rev: 37942
This commit is contained in:
parent
eef3e8f0f7
commit
1f9540cce1
1 changed files with 5 additions and 6 deletions
|
@ -1972,13 +1972,12 @@ public class TestFmwk extends AbstractTestLog {
|
|||
// Return the source code location of the caller located callDepth frames up the stack.
|
||||
public static String sourceLocation() {
|
||||
// Walk up the stack to the first call site outside this file
|
||||
StackTraceElement[] st = new Throwable().getStackTrace();
|
||||
for (int i = 0; i < st.length; ++i) {
|
||||
String source = st[i].getFileName();
|
||||
for (StackTraceElement st : new Throwable().getStackTrace()) {
|
||||
String source = st.getFileName();
|
||||
if (!source.equals("TestFmwk.java") && !source.equals("AbstractTestLog.java")) {
|
||||
String methodName = st[i].getMethodName();
|
||||
if (methodName.startsWith("Test") || methodName.startsWith("test")) {
|
||||
return "(" + source + ":" + st[i].getLineNumber() + ") ";
|
||||
String methodName = st.getMethodName();
|
||||
if (methodName.startsWith("Test") || methodName.startsWith("test") || methodName.equals("main")) {
|
||||
return "(" + source + ":" + st.getLineNumber() + ") ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue