ICU-11803 fixed (but see comments)

X-SVN-Rev: 37917
This commit is contained in:
Mark Davis 2015-09-09 13:04:56 +00:00
parent c5396b67a2
commit 2c7e3cfe4d
2 changed files with 22 additions and 8 deletions

View File

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (c) 2003-2009, International Business Machines
* Copyright (c) 2003-2015, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Author: Alan Liu
@ -227,4 +227,15 @@ public class UtilityTest extends TestFmwk {
errln("FAIL: str1("+str1+") != str2("+str2+")");
}
}
public void TestSourceLocation() {
String here = TestFmwk.sourceLocation();
String there = CheckSourceLocale();
String hereAgain = TestFmwk.sourceLocation();
assertTrue("here < there < hereAgain", here.compareTo(there) < 0 && there.compareTo(hereAgain) < 0);
}
public String CheckSourceLocale() {
return TestFmwk.sourceLocation();
}
}

View File

@ -1547,14 +1547,14 @@ public class TestFmwk extends AbstractTestLog {
private void msg(String message, int level, boolean incCount,
boolean newln) {
int oldLevel = level;
// if (level == WARN && (!warnings && !nodata)){
// level = ERR;
// }
// if (level == WARN && (!warnings && !nodata)){
// level = ERR;
// }
if (incCount) {
if (level == WARN) {
warnCount++;
// invalidCount++;
// invalidCount++;
} else if (level == ERR) {
errorCount++;
}
@ -1683,8 +1683,8 @@ public class TestFmwk extends AbstractTestLog {
+ " failure(s)"
+ ((warnDelta != 0) ? ", " + warnDelta
+ " warning(s)" : "")
+ ((invalidDelta != 0) ? ", " + invalidDelta
+ " test(s) skipped)" : ")"));
+ ((invalidDelta != 0) ? ", " + invalidDelta
+ " test(s) skipped)" : ")"));
} else if (warnDelta != 0) {
log.println(" ALERT ("
+ warnDelta
@ -1976,7 +1976,10 @@ public class TestFmwk extends AbstractTestLog {
for (int i = 0; i < st.length; ++i) {
String source = st[i].getFileName();
if (!source.equals("TestFmwk.java") && !source.equals("AbstractTestLog.java")) {
return "(" + st[i].getFileName() + ":" + st[i].getLineNumber() + ") ";
String methodName = st[i].getMethodName();
if (methodName.startsWith("Test") || methodName.startsWith("test")) {
return "(" + source + ":" + st[i].getLineNumber() + ") ";
}
}
}
throw new InternalError();