This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
See attached patch which adds to JunitTestCaseAdapter, DOMTestCase.java, DOMTestFramework.java void assertSame(DOMTestCase, String assertID, int, int) void assertSame(DOMTestCase, String assertID, double, double) boolean same(int, int) boolean same(int, int) and modifies assertEquals(DOMTestCase, String assertID, double, double) in JUnitTestCaseAdapter
Created attachment 100 [details] patch v1 oops, the second boolean same(int, int) in the above comment should have been boolean same(double, double) :-) The patch is ok though.
Same was intended to mean that two references were to the same object. That is, an object identity comparison instead of an object value comparision. Since the types used to represent double, int and boolean do not have identity, the use of same was not expected for these types. Unless there is a compelling reason, I would suggest the tests to be rewritten using equals or assertEquals. JUnit also maintains this distinction, assertSame is only defined for Object, assertEquals is defined for Object and the value types. I did modify JUnitTestCaseAdapter to use assertEquals(String, double, double, double delta) using a delta value of 0 instead of doing a string comparison. This will report the expected and actual values in any failure message which would make it preferable to assert(actual == expected)
Created attachment 105 [details] Changes implementation of JUnitTestCaseAdapter.assertEquals(double
This works for me as well. Please close unless there is another reason to keep it open.