summaryrefslogtreecommitdiff
path: root/opendc-kernel-omega/src/test
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2018-02-14 12:32:57 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2018-02-14 12:32:57 +0100
commit157d30beb52c75831e29a1a22c199b95d6d30b42 (patch)
treec425bd9c5c6c76aa675634dd8c21590055f26f65 /opendc-kernel-omega/src/test
parent2e819d59934b5308bc58d6c69709112e2a6af402 (diff)
refactor(#18): Create distinction between kernel and simulation
This change creates a distinction between a kernel and a simulation. A single simulation is represented by a `Simulation` object which provides control over the simulation, while the `Kernel` interface allows users to create a new simulation using that kernel as backend.
Diffstat (limited to 'opendc-kernel-omega/src/test')
-rw-r--r--opendc-kernel-omega/src/test/kotlin/com/atlarge/opendc/omega/SmokeTest.kt18
1 files changed, 9 insertions, 9 deletions
diff --git a/opendc-kernel-omega/src/test/kotlin/com/atlarge/opendc/omega/SmokeTest.kt b/opendc-kernel-omega/src/test/kotlin/com/atlarge/opendc/omega/SmokeTest.kt
index 48b4f02a..74fa686b 100644
--- a/opendc-kernel-omega/src/test/kotlin/com/atlarge/opendc/omega/SmokeTest.kt
+++ b/opendc-kernel-omega/src/test/kotlin/com/atlarge/opendc/omega/SmokeTest.kt
@@ -66,8 +66,8 @@ internal class SmokeTest {
}
}
}
- val kernel = OmegaKernelFactory.create(bootstrap)
- kernel.run()
+ val simulation = OmegaKernel.create(bootstrap)
+ simulation.run()
}
object NullProcess : Process<Unit, Unit> {
@@ -88,8 +88,8 @@ internal class SmokeTest {
}
}
- val kernel = OmegaKernelFactory.create(bootstrap)
- kernel.run()
+ val simulation = OmegaKernel.create(bootstrap)
+ simulation.run()
}
object CrashProcess : Process<Unit, Unit> {
@@ -112,8 +112,8 @@ internal class SmokeTest {
}
}
- val kernel = OmegaKernelFactory.create(bootstrap)
- kernel.run()
+ val simulation = OmegaKernel.create(bootstrap)
+ simulation.run()
}
class ModelProcess(private val value: Int) : Process<Boolean, Int> {
@@ -136,9 +136,9 @@ internal class SmokeTest {
value
}
- val kernel = OmegaKernelFactory.create(bootstrap)
- kernel.run(5)
+ val simulation = OmegaKernel.create(bootstrap)
+ simulation.run(5)
- assertTrue(kernel.run { process.state })
+ assertTrue(simulation.run { process.state })
}
}