diff --git a/core/testtools/src/main/java/org/arakhne/afc/testtools/AbstractTestCase.java b/core/testtools/src/main/java/org/arakhne/afc/testtools/AbstractTestCase.java index a4c1679ff..76271dfc7 100644 --- a/core/testtools/src/main/java/org/arakhne/afc/testtools/AbstractTestCase.java +++ b/core/testtools/src/main/java/org/arakhne/afc/testtools/AbstractTestCase.java @@ -168,16 +168,14 @@ public boolean isEpsilonEquals(double[] v1, double[] v2) { if (v1 == v2) { return true; } - if (v1 == null && v2 != null) { + if (v1 == null || v2 == null) { return false; } - if (v1 != null && v2 == null) { - return false; - } - assert v1 != null && v2 != null; + if (v1.length != v2.length) { return false; } + assert v1 != null && v2 != null; for (int i = 0; i < v1.length; ++i) { if (!isEpsilonEquals(v1[i], v2[i])) { return false; @@ -1192,16 +1190,12 @@ protected static void assertEpsilonEquals(Date expected, Date actual) { if (expected == actual) { return; } - if (expected == null && actual != null) { + if (expected == null || actual == null) { throw new ComparisonFailure(formatFailMessage("not same", expected, actual), //$NON-NLS-1$ null, actual.toString()); } - if (expected != null && actual == null) { - throw new ComparisonFailure(formatFailMessage("not same", expected, actual), //$NON-NLS-1$ - expected.toString(), - null); - } + assert expected != null && actual != null; final DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); //$NON-NLS-1$ final String expectedStr = fmt.format(expected);