Skip to content

Commit

Permalink
Use JUNit assertions not assert in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbASF committed Jul 29, 2024
1 parent ad9c573 commit 81f25ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private static double compositeSimpsonsRule(UnivariateFunction f, double a,
// 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public void testGLSEfficiency() {
}

// 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());
}
}

0 comments on commit 81f25ca

Please sign in to comment.