You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ps...@apache.org on 2004/04/02 23:30:08 UTC
cvs commit: jakarta-commons/math/src/test/org/apache/commons/math TestUtils.java
psteitz 2004/04/02 13:30:08
Modified: math/src/test/org/apache/commons/math TestUtils.java
Log:
Added method to check that two double arrays are equal.
Revision Changes Path
1.12 +11 -1 jakarta-commons/math/src/test/org/apache/commons/math/TestUtils.java
Index: TestUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/TestUtils.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- TestUtils.java 18 Mar 2004 05:52:37 -0000 1.11
+++ TestUtils.java 2 Apr 2004 21:30:08 -0000 1.12
@@ -58,6 +58,16 @@
assertEquals(expected.getImaginary(), actual.getImaginary(), delta);
}
+ /**
+ * Verifies that two double arrays have equal entries, up to tolerance
+ */
+ public static void assertEquals(double a[], double b[], double tolerance) {
+ Assert.assertEquals(a.length, b.length);
+ for (int i = 0; i < a.length; i++) {
+ Assert.assertEquals(a[i], b[i], tolerance);
+ }
+ }
+
public static Object serializeAndRecover(Object o){
Object result = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org