From bb3b8e207a08edff81b8c2fe30b476c94bfea086 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 17 Mar 2021 16:23:48 +0100 Subject: simulator: Make hypervisors generic for the resource type This change moves the hypervisor implementations to the opendc-simulator-resources module and makes them generic to the resource type that is being used (e.g., CPU, disk or networking). --- .../src/test/kotlin/org/opendc/utils/TimerSchedulerTest.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'simulator/opendc-utils/src/test/kotlin/org/opendc/utils') diff --git a/simulator/opendc-utils/src/test/kotlin/org/opendc/utils/TimerSchedulerTest.kt b/simulator/opendc-utils/src/test/kotlin/org/opendc/utils/TimerSchedulerTest.kt index 3a4acc90..1fcb5d38 100644 --- a/simulator/opendc-utils/src/test/kotlin/org/opendc/utils/TimerSchedulerTest.kt +++ b/simulator/opendc-utils/src/test/kotlin/org/opendc/utils/TimerSchedulerTest.kt @@ -38,7 +38,7 @@ internal class TimerSchedulerTest { fun testBasicTimer() { runBlockingTest { val clock = DelayControllerClockAdapter(this) - val scheduler = TimerScheduler(this, clock) + val scheduler = TimerScheduler(coroutineContext, clock) scheduler.startSingleTimer(0, 1000) { scheduler.close() @@ -51,7 +51,7 @@ internal class TimerSchedulerTest { fun testCancelNonExisting() { runBlockingTest { val clock = DelayControllerClockAdapter(this) - val scheduler = TimerScheduler(this, clock) + val scheduler = TimerScheduler(coroutineContext, clock) scheduler.cancel(1) scheduler.close() @@ -62,7 +62,7 @@ internal class TimerSchedulerTest { fun testCancelExisting() { runBlockingTest { val clock = DelayControllerClockAdapter(this) - val scheduler = TimerScheduler(this, clock) + val scheduler = TimerScheduler(coroutineContext, clock) scheduler.startSingleTimer(0, 1000) { assertFalse(false) @@ -81,7 +81,7 @@ internal class TimerSchedulerTest { fun testCancelAll() { runBlockingTest { val clock = DelayControllerClockAdapter(this) - val scheduler = TimerScheduler(this, clock) + val scheduler = TimerScheduler(coroutineContext, clock) scheduler.startSingleTimer(0, 1000) { assertFalse(false) @@ -99,7 +99,7 @@ internal class TimerSchedulerTest { fun testOverride() { runBlockingTest { val clock = DelayControllerClockAdapter(this) - val scheduler = TimerScheduler(this, clock) + val scheduler = TimerScheduler(coroutineContext, clock) scheduler.startSingleTimer(0, 1000) { assertFalse(false) @@ -117,7 +117,7 @@ internal class TimerSchedulerTest { fun testStopped() { runBlockingTest { val clock = DelayControllerClockAdapter(this) - val scheduler = TimerScheduler(this, clock) + val scheduler = TimerScheduler(coroutineContext, clock) scheduler.close() @@ -133,7 +133,7 @@ internal class TimerSchedulerTest { fun testNegativeDelay() { runBlockingTest { val clock = DelayControllerClockAdapter(this) - val scheduler = TimerScheduler(this, clock) + val scheduler = TimerScheduler(coroutineContext, clock) assertThrows { scheduler.startSingleTimer(1, -1) { -- cgit v1.2.3