#58 FloatingPointTolerantDifferenceListener should use <=

Java_1.2
closed-fixed
nobody
None
5
2014-12-29
2012-12-06
david rees
No

FloatingPointTolerantDifferenceListener should have line 63 updated as follows so it uses <= for comparing its values rather than <.
return Math.abs(controlVal - testVal) < tolerance

This would make it more consistent with its description "if they only differ by a given tolerance value (or less)". I also will expand its usefulness to the larger case of values that are textually different but numerically equal (e.g 0 = 0.0, 0.1000 = 0.1).

Discussion

  • Stefan Bodewig

    Stefan Bodewig - 2013-02-03
    • status: open --> pending-fixed
     
  • Stefan Bodewig

    Stefan Bodewig - 2013-02-03

    fixed with svn revision 510, will be fixed in XMLUnit 1.4.

    Thanks

     
  • Stefan Bodewig

    Stefan Bodewig - 2013-09-12

    true, but the tolerance value is configurable, which meliorates the problem if people know the maginitude of the expected values. And it's inside the examples package after all :-)

    I'll add a comment to the source.

     
  • Stefan Bodewig

    Stefan Bodewig - 2014-12-29
    • status: pending-fixed --> closed-fixed
    • Group: --> Java_1.2
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks