@@ -404,18 +404,33 @@ public static void assertAxisDirectionsEqual(final CoordinateSystem cs, final Ax
404404 }
405405 }
406406
407+ /**
408+ * Asserts that the given matrix is equal to the expected one, with a tolerance of zero.
409+ * Positive zeros are considered equal to negative zeros, and any NaN value is considered equal
410+ * to all other NaN values.
411+ *
412+ * @param expected the expected matrix, which may be {@code null}.
413+ * @param actual the matrix to compare, or {@code null}.
414+ * @param label header of the exception message in case of failure, or {@code null} if none.
415+ */
416+ public static void assertMatrixEquals (final Matrix expected , final Matrix actual , final String label ) {
417+ assertMatrixEquals (expected , actual , 0 , label );
418+ }
419+
407420 /**
408421 * Asserts that the given matrix is equal to the expected one, up to the given tolerance value.
422+ * Positive zeros are considered equal to negative zeros, and any NaN value is considered equal
423+ * to all other NaN values.
409424 *
410425 * @param expected the expected matrix, which may be {@code null}.
411426 * @param actual the matrix to compare, or {@code null}.
412427 * @param tolerance the tolerance threshold.
413- * @param message header of the exception message in case of failure, or {@code null} if none.
428+ * @param label header of the exception message in case of failure, or {@code null} if none.
414429 *
415430 * @see org.opengis.test.referencing.TransformTestCase#assertMatrixEquals(Matrix, Matrix, Matrix, String)
416431 */
417- public static void assertMatrixEquals (final Matrix expected , final Matrix actual , final double tolerance , final String message ) {
418- if (isNull (expected , actual , message )) {
432+ public static void assertMatrixEquals (final Matrix expected , final Matrix actual , final double tolerance , final String label ) {
433+ if (isNull (expected , actual , label )) {
419434 return ;
420435 }
421436 final int numRow = actual .getNumRow ();
@@ -427,7 +442,7 @@ public static void assertMatrixEquals(final Matrix expected, final Matrix actual
427442 final double e = expected .getElement (j ,i );
428443 final double a = actual .getElement (j ,i );
429444 if (!(StrictMath .abs (e - a ) <= tolerance ) && Double .doubleToLongBits (a ) != Double .doubleToLongBits (e )) {
430- fail (nonNull (message ) + "Matrix.getElement(" + j + ", " + i + "): expected " + e + " but got " + a );
445+ fail (nonNull (label ) + "Matrix.getElement(" + j + ", " + i + "): expected " + e + " but got " + a );
431446 }
432447 }
433448 }
0 commit comments