diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-05 14:10:11 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-05 14:10:11 +0200 |
| commit | be176910eb870209576326ffaad8bf21241fccbd (patch) | |
| tree | 3903d8aed5e87850c92e1b2dce8379ea99bdfa6d /opendc-common/src/test/kotlin | |
| parent | c214a7fe0d46ecc23a71f9237b20281c0ca1c929 (diff) | |
refactor(sim/core): Rename runBlockingSimulation to runSimulation
This change renames the method `runBlockingSimulation` to
`runSimulation` to put more emphasis on the simulation part of the
method. The blocking part is not that important, but this behavior is
still described in the method documentation.
Diffstat (limited to 'opendc-common/src/test/kotlin')
| -rw-r--r-- | opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt | 12 | ||||
| -rw-r--r-- | opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt b/opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt index 066bc13b..de9fd472 100644 --- a/opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt +++ b/opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt @@ -26,7 +26,7 @@ import kotlinx.coroutines.delay import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.opendc.simulator.kotlin.runBlockingSimulation +import org.opendc.simulator.kotlin.runSimulation import java.time.Clock import kotlin.coroutines.EmptyCoroutineContext @@ -43,7 +43,7 @@ class PacerTest { fun testSingleEnqueue() { var count = 0 - runBlockingSimulation { + runSimulation { val pacer = Pacer(coroutineContext, clock, quantum = 100) { count++ } @@ -58,7 +58,7 @@ class PacerTest { fun testCascade() { var count = 0 - runBlockingSimulation { + runSimulation { val pacer = Pacer(coroutineContext, clock, quantum = 100) { count++ } @@ -76,7 +76,7 @@ class PacerTest { fun testCancel() { var count = 0 - runBlockingSimulation { + runSimulation { val pacer = Pacer(coroutineContext, clock, quantum = 100) { count++ } @@ -94,7 +94,7 @@ class PacerTest { fun testCancelWithoutPending() { var count = 0 - runBlockingSimulation { + runSimulation { val pacer = Pacer(coroutineContext, clock, quantum = 100) { count++ } @@ -112,7 +112,7 @@ class PacerTest { fun testSubsequent() { var count = 0 - runBlockingSimulation { + runSimulation { val pacer = Pacer(coroutineContext, clock, quantum = 100) { count++ } diff --git a/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt b/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt index 93da5646..183ab66a 100644 --- a/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt +++ b/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt @@ -26,7 +26,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.opendc.simulator.kotlin.runBlockingSimulation +import org.opendc.simulator.kotlin.runSimulation import java.time.Clock import kotlin.coroutines.EmptyCoroutineContext @@ -42,7 +42,7 @@ internal class TimerSchedulerTest { @Test fun testBasicTimer() { - runBlockingSimulation { + runSimulation { val scheduler = TimerScheduler<Int>(coroutineContext, clock) scheduler.startSingleTimer(0, 1000) { @@ -56,7 +56,7 @@ internal class TimerSchedulerTest { @Test fun testCancelNonExisting() { - runBlockingSimulation { + runSimulation { val scheduler = TimerScheduler<Int>(coroutineContext, clock) scheduler.cancel(1) @@ -65,7 +65,7 @@ internal class TimerSchedulerTest { @Test fun testCancelExisting() { - runBlockingSimulation { + runSimulation { val scheduler = TimerScheduler<Int>(coroutineContext, clock) scheduler.startSingleTimer(0, 1000) { @@ -82,7 +82,7 @@ internal class TimerSchedulerTest { @Test fun testCancelAll() { - runBlockingSimulation { + runSimulation { val scheduler = TimerScheduler<Int>(coroutineContext, clock) scheduler.startSingleTimer(0, 1000) { fail() } @@ -93,7 +93,7 @@ internal class TimerSchedulerTest { @Test fun testOverride() { - runBlockingSimulation { + runSimulation { val scheduler = TimerScheduler<Int>(coroutineContext, clock) scheduler.startSingleTimer(0, 1000) { fail() } @@ -107,7 +107,7 @@ internal class TimerSchedulerTest { @Test fun testOverrideBlock() { - runBlockingSimulation { + runSimulation { val scheduler = TimerScheduler<Int>(coroutineContext, clock) scheduler.startSingleTimer(0, 1000) { fail() } @@ -120,7 +120,7 @@ internal class TimerSchedulerTest { @Test fun testNegativeDelay() { - runBlockingSimulation { + runSimulation { val scheduler = TimerScheduler<Int>(coroutineContext, clock) assertThrows<IllegalArgumentException> { |
