summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-flow/src/test
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-09-30 11:55:27 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-10-03 17:17:39 +0200
commit7b2d03add3170b9142bf42c5a64aaa263773caf7 (patch)
tree341fbc68154156fbea250db5d29a6e38e7a69fe5 /opendc-simulator/opendc-simulator-flow/src/test
parent4cc1d40d421c8736f8b21b360b61d6b065158b7a (diff)
refactor(simulator): Separate push and pull flags
This change separates the push and pull flags in FlowConsumerContextImpl, meaning that sources can now push directly without pulling and vice versa.
Diffstat (limited to 'opendc-simulator/opendc-simulator-flow/src/test')
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowConsumerContextTest.kt17
1 files changed, 0 insertions, 17 deletions
diff --git a/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowConsumerContextTest.kt b/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowConsumerContextTest.kt
index 061ebea6..380fd38a 100644
--- a/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowConsumerContextTest.kt
+++ b/opendc-simulator/opendc-simulator-flow/src/test/kotlin/org/opendc/simulator/flow/FlowConsumerContextTest.kt
@@ -28,7 +28,6 @@ import org.junit.jupiter.api.*
import org.opendc.simulator.core.runBlockingSimulation
import org.opendc.simulator.flow.internal.FlowConsumerContextImpl
import org.opendc.simulator.flow.internal.FlowEngineImpl
-import org.opendc.simulator.flow.source.FixedFlowSource
/**
* A test suite for the [FlowConsumerContextImpl] class.
@@ -56,22 +55,6 @@ class FlowConsumerContextTest {
}
@Test
- fun testIntermediateFlush() = runBlockingSimulation {
- val engine = FlowEngineImpl(coroutineContext, clock)
- val consumer = FixedFlowSource(1.0, 1.0)
-
- val logic = spyk(object : FlowConsumerLogic {})
- val context = FlowConsumerContextImpl(engine, consumer, logic)
- context.capacity = 1.0
-
- context.start()
- delay(1) // Delay 1 ms to prevent hitting the fast path
- engine.scheduleSync(engine.clock.millis(), context)
-
- verify(exactly = 2) { logic.onPush(any(), any(), any(), any()) }
- }
-
- @Test
fun testDoubleStart() = runBlockingSimulation {
val engine = FlowEngineImpl(coroutineContext, clock)
val consumer = object : FlowSource {