commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Maisonobe <Luc.Maison...@free.fr>
Subject Re: [MATH] don't know how to fix UnivariateRealSolverUtilsTest.java test failures
Date Fri, 01 Oct 2010 15:52:10 GMT
Le 01/10/2010 17:01, sebb AT ASF a écrit :
> The following tests were updated recently to add fail() calls, but the
> IAE is not generated.
> 
> Anyone have an idea how to fix the tests so the IAE is thrown?
> 
>     public void testSolveBadEndpoints() throws MathException {
>         try { // bad endpoints
>             UnivariateRealSolverUtils.solve(sin,0.0, 4.0, 4.0);

Change the second argument from 0.0 to -0.1

>             fail("Expecting IllegalArgumentException");
>         } catch (IllegalArgumentException ex) {
>             // expected
>         }
>     }
> 
>     public void testSolveBadAccuracy() throws MathException {
>         try { // bad accuracy
>             UnivariateRealSolverUtils.solve(sin, 0.0, 4.0, 0.0);

I guess this one cannot be triggered anymore since changes to
convergence behavior. The ConvergingAlgorithm that provides the
setAbsoluteAccuracy method is now deprecated in 2.2, should be removed
in 3.0 but is still there, and doesn't check the accuracy is positive.

I guess it's a work in progress.

Luc


>             fail("Expecting IllegalArgumentException");
>         } catch (IllegalArgumentException ex) {
>             // expected
>         }
>     }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


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


Mime
View raw message