Skip to content

Commit

Permalink
Made testQuietMeasuring() fail if creation cost deviates at all
Browse files Browse the repository at this point in the history
  • Loading branch information
kabutz committed Aug 13, 2015
1 parent aa2bf2a commit 672fbc9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/test/java/ByteWatcherSingleThreadTest.java
Expand Up @@ -9,14 +9,14 @@ public class ByteWatcherSingleThreadTest {
public void testQuietMeasuring() {
ByteWatcherSingleThread am = new ByteWatcherSingleThread();
System.out.println("MeasuringCostInBytes = " + am.getMeasuringCostInBytes());
am.calculateAllocations();
am.reset();

for (int i = 0; i < 100_000; i++) {
// this must not run for too long, otherwise we will pick up
// anomalies from the HotSpot compilation of this method
for (int i = 0; i < 10000; i++) {
long mark1 = am.calculateAllocations();
try {
assertEquals(0, mark1);
} catch (AssertionError e) {
System.out.println("RUN:" + i + ":" + mark1);
}
assertEquals(0, mark1);
am.reset();
}
}
Expand Down

0 comments on commit 672fbc9

Please sign in to comment.