diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerNelderMeadTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerNelderMeadTest.java index bd2ad2550..6745c5116 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerNelderMeadTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerNelderMeadTest.java @@ -245,7 +245,7 @@ private void doTest(MultivariateFunction func, Assert.assertEquals(name + ": distance to optimum", 0d, dist, tol); final int nEval = optim.getEvaluations(); - Assert.assertTrue(name + ": nEval=" + nEval, + Assert.assertTrue(name + ": nEval=" + nEval + " < " + maxEvaluations, nEval < maxEvaluations); } } diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerTest.java index 43b00de93..c7826cae7 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerTest.java @@ -232,7 +232,7 @@ public String toString() { final int nEval = optim.getEvaluations(); Assertions.assertTrue(nEval < functionEvaluations, - () -> name + ": nEval=" + nEval); + () -> name + ": nEval=" + nEval + " < " + functionEvaluations); } /**