Skip to content

Commit

Permalink
Remove Assertions.equals using 0d
Browse files Browse the repository at this point in the history
  • Loading branch information
aherbert committed Jul 15, 2020
1 parent 44a4860 commit 2b9f0c5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Expand Up @@ -76,8 +76,8 @@ void testMoments() {
ConstantContinuousDistribution dist;

dist = new ConstantContinuousDistribution(-1);
Assertions.assertEquals(-1, dist.getMean(), 0d);
Assertions.assertEquals(0, dist.getVariance(), 0d);
Assertions.assertEquals(-1, dist.getMean());
Assertions.assertEquals(0, dist.getVariance());
}

@Test
Expand Down
Expand Up @@ -313,12 +313,12 @@ void testOutsideSupport() {
final double below = lo - Math.ulp(lo);
final double above = hi + Math.ulp(hi);

Assertions.assertEquals(0d, distribution.density(below), 0d);
Assertions.assertEquals(0d, distribution.density(above), 0d);
Assertions.assertEquals(Double.NEGATIVE_INFINITY, distribution.logDensity(below), 0d);
Assertions.assertEquals(Double.NEGATIVE_INFINITY, distribution.logDensity(above), 0d);
Assertions.assertEquals(0d, distribution.cumulativeProbability(below), 0d);
Assertions.assertEquals(1d, distribution.cumulativeProbability(above), 0d);
Assertions.assertEquals(0d, distribution.density(below));
Assertions.assertEquals(0d, distribution.density(above));
Assertions.assertEquals(Double.NEGATIVE_INFINITY, distribution.logDensity(below));
Assertions.assertEquals(Double.NEGATIVE_INFINITY, distribution.logDensity(above));
Assertions.assertEquals(0d, distribution.cumulativeProbability(below));
Assertions.assertEquals(1d, distribution.cumulativeProbability(above));
}

/**
Expand Down
Expand Up @@ -305,7 +305,7 @@ void testZeroTrial() {

for (int i = 1; i <= n; i++) {
final double p = dist.probability(i);
Assertions.assertEquals(0, p, 0d, () -> "p=" + p);
Assertions.assertEquals(0, p, () -> "p=" + p);
}
}

Expand All @@ -317,7 +317,7 @@ void testMath1356() {
for (int s = 0; s <= n; s++) {
final HypergeometricDistribution dist = new HypergeometricDistribution(n, m, s);
final double p = dist.probability(s);
Assertions.assertEquals(1, p, 0d, () -> "p=" + p);
Assertions.assertEquals(1, p, () -> "p=" + p);
}
}

Expand Down
Expand Up @@ -180,7 +180,7 @@ void testLowerTail() {
if (i < 39) { // make sure not top-coded
Assertions.assertTrue(lowerTail > 0);
} else { // make sure top coding not reversed
Assertions.assertEquals(0, lowerTail, 0d);
Assertions.assertEquals(0, lowerTail);
}
}
}
Expand All @@ -197,7 +197,7 @@ void testUpperTail() {
if (i < 9) { // make sure not top-coded
Assertions.assertTrue(upperTail < 1);
} else { // make sure top coding not reversed
Assertions.assertEquals(1, upperTail, 0d);
Assertions.assertEquals(1, upperTail);
}
}
}
Expand Down

0 comments on commit 2b9f0c5

Please sign in to comment.