Skip to content

Commit 9088064

Browse files
author
zhourenjian
committed
Fixed J2SUnit bug: assertEquals (1, 3) is passed!
1 parent a07a7f7 commit 9088064

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

sources/net.sf.j2s.java.junit/src/junit/framework/Assert.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ static public void assertEquals(String message, Object expected, Object actual)
7070
/**
7171
* Asserts that two objects are equal. If they are not
7272
* an AssertionFailedError is thrown.
73+
*
74+
* @j2sNativeSrc
75+
* junit.framework.Assert.assertEquals (Clazz.castNullAs("String"), expected, actual);
76+
* @j2sNative
77+
* junit.framework.Assert.assertEquals (Clazz.castNullAs("String"), a, b);
7378
*/
7479
static public void assertEquals(Object expected, Object actual) {
7580
assertEquals(null, expected, actual);

sources/net.sf.j2s.java.junit/src/junit/runner/BaseTestRunner.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ public Test getTest(String suiteClassName) {
129129
* Returns the formatted string of the elapsed time.
130130
*/
131131
public String elapsedTimeAsString(long runTime) {
132-
return NumberFormat.getInstance().format((double)runTime/1000);
132+
return "" + ((double)runTime/1000);
133+
//return NumberFormat.getInstance().format((double)runTime/1000);
133134
}
134135

135136
/**

0 commit comments

Comments
 (0)