summaryrefslogtreecommitdiff
path: root/opendc-common/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-common/src/test')
-rw-r--r--opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt12
-rw-r--r--opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt16
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> {