Use JUNit assertions not assert in tests

This commit is contained in:
Sebb 2024-07-30 00:08:35 +01:00
parent ad9c573012
commit 81f25ca2cc
2 changed files with 3 additions and 3 deletions

View File

@ -200,7 +200,7 @@ public final class SimpsonIntegratorTest {
// sum ~ h/3 * [ f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + 2f(x4) ... + 4f(xn-1) + f(xn) ]
// h = (b-a)/n
// f(xi) = f(a + i*h)
assert n > 0 && (n & 1) == 0 : "n must be strictly positive and even";
Assert.assertTrue( "n must be strictly positive and even, actual: " +n, n > 0 && (n & 1) == 0);
final double h = (b - a) / n;
double sum4 = 0;
double sum2 = 0;

View File

@ -293,7 +293,7 @@ public class GLSMultipleLinearRegressionTest extends MultipleLinearRegressionAbs
}
// Verify that GLS is on average more efficient, lower variance
assert olsBetaStats.getMean() > 1.5 * glsBetaStats.getMean();
assert olsBetaStats.getStandardDeviation() > glsBetaStats.getStandardDeviation();
Assert.assertTrue(olsBetaStats.getMean() > 1.5 * glsBetaStats.getMean());
Assert.assertTrue(olsBetaStats.getStandardDeviation() > glsBetaStats.getStandardDeviation());
}
}