commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r359091 - /jakarta/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/LaguerreSolverTest.java
Date Mon, 26 Dec 2005 20:00:56 GMT
Author: psteitz
Date: Mon Dec 26 12:00:54 2005
New Revision: 359091

URL: http://svn.apache.org/viewcvs?rev=359091&view=rev
Log:
Removed dependency on ordering of roots using TestUtils.assertContains.

Modified:
    jakarta/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/LaguerreSolverTest.java

Modified: jakarta/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/LaguerreSolverTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/LaguerreSolverTest.java?rev=359091&r1=359090&r2=359091&view=diff
==============================================================================
--- jakarta/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/LaguerreSolverTest.java
(original)
+++ jakarta/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/LaguerreSolverTest.java
Mon Dec 26 12:00:54 2005
@@ -16,6 +16,7 @@
 package org.apache.commons.math.analysis;
 
 import org.apache.commons.math.MathException;
+import org.apache.commons.math.TestUtils;
 import org.apache.commons.math.complex.Complex;
 import junit.framework.TestCase;
 
@@ -116,32 +117,30 @@
         LaguerreSolver solver = new LaguerreSolver(f);
         result = solver.solveAll(coefficients, initial);
 
-        // The order of roots returned by solveAll() depends on
-        // initial value, solveAll() does no sorting.
         expected = new Complex(0.0, -2.0);
         tolerance = Math.max(solver.getAbsoluteAccuracy(),
                     Math.abs(expected.abs() * solver.getRelativeAccuracy()));
-        assertEquals(0.0, (expected.subtract(result[0])).abs(), tolerance);
+        TestUtils.assertContains(result, expected, tolerance);
 
         expected = new Complex(0.0, 2.0);
         tolerance = Math.max(solver.getAbsoluteAccuracy(),
                     Math.abs(expected.abs() * solver.getRelativeAccuracy()));
-        assertEquals(0.0, (expected.subtract(result[1])).abs(), tolerance);
+        TestUtils.assertContains(result, expected, tolerance);
 
         expected = new Complex(0.5, 0.5 * Math.sqrt(3.0));
         tolerance = Math.max(solver.getAbsoluteAccuracy(),
                     Math.abs(expected.abs() * solver.getRelativeAccuracy()));
-        assertEquals(0.0, (expected.subtract(result[3])).abs(), tolerance);
+        TestUtils.assertContains(result, expected, tolerance);
 
         expected = new Complex(-1.0, 0.0);
         tolerance = Math.max(solver.getAbsoluteAccuracy(),
                     Math.abs(expected.abs() * solver.getRelativeAccuracy()));
-        assertEquals(0.0, (expected.subtract(result[4])).abs(), tolerance);
-
+        TestUtils.assertContains(result, expected, tolerance);
+        
         expected = new Complex(0.5, -0.5 * Math.sqrt(3.0));
         tolerance = Math.max(solver.getAbsoluteAccuracy(),
                     Math.abs(expected.abs() * solver.getRelativeAccuracy()));
-        assertEquals(0.0, (expected.subtract(result[2])).abs(), tolerance);
+        TestUtils.assertContains(result, expected, tolerance);
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message