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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to