Skip to content

Commit

Permalink
Remove assert messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gstamatelat committed Jul 2, 2018
1 parent 30f0b38 commit dab22d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/test/java/gr/james/sampling/ChaoSamplingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ public void correctness() {
}
final double diff = 2.0 * (REPS * SAMPLE) / (STREAM * (STREAM + 1));
for (int i = 0; i < d.length - 1; i++) {
Assert.assertEquals("ChaoSamplingTest.correctness",
1.0, (d[i + 1] - d[i]) / diff, 1e-2);
Assert.assertEquals(1.0, (d[i + 1] - d[i]) / diff, 1e-2);
}
}

Expand All @@ -57,8 +56,7 @@ public void stream() {
}
final double diff = 2.0 * (REPS * SAMPLE) / (STREAM * (STREAM + 1));
for (int i = 0; i < d.length - 1; i++) {
Assert.assertEquals("ChaoSamplingTest.stream",
1.0, (d[i + 1] - d[i]) / diff, 1e-2);
Assert.assertEquals(1.0, (d[i + 1] - d[i]) / diff, 1e-2);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/gr/james/sampling/RandomSamplingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void correctness() {
for (int c : d) {
final double expected = (double) REPS * Math.min(SAMPLE, STREAM) / STREAM;
final double actual = (double) c;
Assert.assertEquals("RandomSamplingTest.correctness", 1, actual / expected, 1e-2);
Assert.assertEquals(1, actual / expected, 1e-2);
}
}
}
Expand Down Expand Up @@ -99,7 +99,7 @@ public void stream20() {
} else if (alg instanceof LiLSampling) {
collector = LiLSampling.collector(SAMPLE, RANDOM);
} else {
throw new AssertionError("RandomSamplingTest.stream");
throw new AssertionError();
}

final Collection<Integer> sample = IntStream.range(0, STREAM).boxed().collect(collector);
Expand All @@ -112,7 +112,7 @@ public void stream20() {
for (int c : d) {
final double expected = (double) REPS * SAMPLE / STREAM;
final double actual = (double) c;
Assert.assertEquals("RandomSamplingTest.stream", 1, actual / expected, 1e-2);
Assert.assertEquals(1, actual / expected, 1e-2);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void correctness() {
}

for (int i = 0; i < d.length - 1; i++) {
Assert.assertTrue("WeightedRandomSamplingTest.correctness", d[i] < d[i + 1]);
Assert.assertTrue(d[i] < d[i + 1]);
}
}
}
Expand All @@ -86,7 +86,7 @@ public void stream20() {
} else if (alg instanceof ChaoSampling) {
collector = ChaoSampling.weightedCollector(SAMPLE, RANDOM);
} else {
throw new AssertionError("WeightedRandomSamplingTest.stream");
throw new AssertionError();
}

final Collection<Integer> sample = IntStream.range(0, STREAM).boxed()
Expand All @@ -99,7 +99,7 @@ public void stream20() {
}

for (int i = 0; i < d.length - 1; i++) {
Assert.assertTrue("WeightedRandomSamplingTest.stream", d[i] < d[i + 1]);
Assert.assertTrue(d[i] < d[i + 1]);
}
}

Expand Down

0 comments on commit dab22d3

Please sign in to comment.