From 55e5c1060cc6c4753e7d64ca34c753797f22a170 Mon Sep 17 00:00:00 2001 From: Sebb Date: Sun, 24 Dec 2023 17:28:54 +0000 Subject: [PATCH] Show more test context --- .../scalar/noderiv/SimplexOptimizerNelderMeadTest.java | 2 +- .../optim/nonlinear/scalar/noderiv/SimplexOptimizerTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); } /**