From: SourceForge.net <no...@so...> - 2008-06-10 22:13:50
|
Bugs item #1990235, was opened at 2008-06-10 23:13 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115278&aid=1990235&group_id=15278 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Toby Byron (snakeeyes) Assigned to: Nobody/Anonymous (nobody) Summary: assertEquals(double expected, double actual) is broken Initial Comment: Assert.assertEquals(double expected, double actual), in the current production codebase (4.4), simply calls assertEquals(String message, double expected, double actual). But that method always calls Assert.fail, with a message telling you to use assertEquals(expected, actual, delta) instead. Methods that always fail like this are extremely annoying. Why are they present at all? If these methods are present solely to maintain backwards compatibility, then their javadoc should mention this auto fail behavior, plus you should deprecate the methods. I should not have had to dig into the source code to learn about it. I argue that these methods DO belong. Sometimes I DO want to compare 2 doubles exactly, and with no error tolerance. And I should not have to add a third argument specifying delta == 0 as that just adds useless info. Please fix ASAP! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115278&aid=1990235&group_id=15278 |
From: SourceForge.net <no...@so...> - 2008-07-10 22:13:03
|
Bugs item #1990235, was opened at 2008-06-10 15:13 Message generated for change (Comment added) made by kbeck You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115278&aid=1990235&group_id=15278 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Toby Byron (snakeeyes) Assigned to: Nobody/Anonymous (nobody) Summary: assertEquals(double expected, double actual) is broken Initial Comment: Assert.assertEquals(double expected, double actual), in the current production codebase (4.4), simply calls assertEquals(String message, double expected, double actual). But that method always calls Assert.fail, with a message telling you to use assertEquals(expected, actual, delta) instead. Methods that always fail like this are extremely annoying. Why are they present at all? If these methods are present solely to maintain backwards compatibility, then their javadoc should mention this auto fail behavior, plus you should deprecate the methods. I should not have had to dig into the source code to learn about it. I argue that these methods DO belong. Sometimes I DO want to compare 2 doubles exactly, and with no error tolerance. And I should not have to add a third argument specifying delta == 0 as that just adds useless info. Please fix ASAP! ---------------------------------------------------------------------- >Comment By: Kent Beck (kbeck) Date: 2008-07-10 15:13 Message: Logged In: YES user_id=117320 Originator: NO assertEquals(double, double) is deprecated in 4.5. In the rare case that you want to compare for identity, you can use assertTrue(f1 == f2). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115278&aid=1990235&group_id=15278 |