MATH-292 TestUtils.assertRelativelyEquals() generates misleading error on failure
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@812871 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
aa91ffbe33
commit
3c6d5dff6e
|
@ -169,8 +169,8 @@ public class TestUtils {
|
|||
} else if (expected == 0.0) {
|
||||
Assert.assertEquals(msg, actual, expected, relativeError);
|
||||
} else {
|
||||
double x = Math.abs((expected - actual) / expected);
|
||||
Assert.assertEquals(msg, 0.0, x, relativeError);
|
||||
double absError = Math.abs(expected) * relativeError;
|
||||
Assert.assertEquals(msg, expected, actual, absError);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue