Skip to content

Commit

Permalink
test: remove timer.iterationStart calls from ConstantThroughputTimerTest
Browse files Browse the repository at this point in the history
  • Loading branch information
vlsi committed Dec 19, 2023
1 parent 9c3c4bd commit 2395d49
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@ class UniformRandomTimerSpec extends Specification {
def sut = new UniformRandomTimer()

def "default delay is 0"() {
given:
sut.iterationStart(null)
when:
def computedDelay = sut.delay()
then:
computedDelay == 0L
}

def "default range is 0"() {
given:
sut.iterationStart(null)
when:
def actualRange = sut.range
then:
Expand All @@ -45,7 +41,6 @@ class UniformRandomTimerSpec extends Specification {
def "delay can be set via a String"() {
given:
sut.setDelay("1")
sut.iterationStart(null)
when:
def computedDelay = sut.delay()
then:
Expand All @@ -57,7 +52,6 @@ class UniformRandomTimerSpec extends Specification {
given:
sut.setDelay(delay)
sut.setRange(range)
sut.iterationStart(null)
when:
def computedDelay = sut.delay()
then:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ void testUniformRandomTimer() throws Exception {
UniformRandomTimer timer = new UniformRandomTimer();
timer.setDelay("1000");
timer.setRange(100d);
timer.iterationStart(null);
long delay = timer.delay();
assertBetween(1000, 1100, delay);
}
Expand All @@ -142,7 +141,6 @@ private static void assertBetween(long expectedLow, long expectedHigh, long actu
void testConstantTimer() throws Exception {
ConstantTimer timer = new ConstantTimer();
timer.setDelay("1000");
timer.iterationStart(null);
Assertions.assertEquals(1000, timer.delay());
}

Expand All @@ -151,7 +149,6 @@ void testPoissonRandomTimerRangeHigherThan30() throws Exception {
PoissonRandomTimer timer = new PoissonRandomTimer();
timer.setDelay("300");
timer.setRange(100d);
timer.iterationStart(null);
long delay = timer.delay();
assertBetween(356, 457, delay);
}
Expand All @@ -161,7 +158,6 @@ void testPoissonRandomTimerRangeLowerThan30() throws Exception {
PoissonRandomTimer timer = new PoissonRandomTimer();
timer.setDelay("300");
timer.setRange(30d);
timer.iterationStart(null);
long delay = timer.delay();
assertBetween(305, 362, delay);
}
Expand Down

0 comments on commit 2395d49

Please sign in to comment.