From 38b0ceb5e1efc7437b0bd789f21f4228f5370ccc Mon Sep 17 00:00:00 2001 From: Artem Demchenko Date: Sun, 5 May 2024 13:59:22 +0300 Subject: [PATCH] Uncomment tests and add `README.md` sample --- work1/README.md | 0 work1/build.gradle.kts | 1 + work1/src/main/kotlin/stack/benchmark/StackBenchmark.kt | 2 +- work1/src/test/kotlin/stack/ConcurrentStackTests.kt | 6 ++++-- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 work1/README.md diff --git a/work1/README.md b/work1/README.md new file mode 100644 index 0000000..e69de29 diff --git a/work1/build.gradle.kts b/work1/build.gradle.kts index 6085f83..ca0b0d0 100644 --- a/work1/build.gradle.kts +++ b/work1/build.gradle.kts @@ -13,6 +13,7 @@ repositories { dependencies { implementation("de.m3y.kformat:kformat:0.11") implementation("org.apache.commons:commons-math3:3.6.1") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0") testImplementation("org.jetbrains.kotlinx:lincheck:2.26") testImplementation("org.jetbrains.kotlin:kotlin-test") } diff --git a/work1/src/main/kotlin/stack/benchmark/StackBenchmark.kt b/work1/src/main/kotlin/stack/benchmark/StackBenchmark.kt index 151b21d..53f99ea 100644 --- a/work1/src/main/kotlin/stack/benchmark/StackBenchmark.kt +++ b/work1/src/main/kotlin/stack/benchmark/StackBenchmark.kt @@ -30,7 +30,7 @@ class StackBenchmark { }.map { it.toStackOperation() } repeat(measureScenario.threadsNum) { - threads.add(thread(false) { + threads.add(thread(start = false) { operations.forEach { it.invoke(measureScenario.initialStack) } }) } diff --git a/work1/src/test/kotlin/stack/ConcurrentStackTests.kt b/work1/src/test/kotlin/stack/ConcurrentStackTests.kt index cdcfe3d..91cc885 100644 --- a/work1/src/test/kotlin/stack/ConcurrentStackTests.kt +++ b/work1/src/test/kotlin/stack/ConcurrentStackTests.kt @@ -5,6 +5,8 @@ import org.jetbrains.kotlinx.lincheck.check import org.jetbrains.kotlinx.lincheck.strategy.managed.modelchecking.ModelCheckingOptions import org.jetbrains.kotlinx.lincheck.strategy.stress.StressOptions import stack.common.ConcurrentStack +import stack.elimination.ConcurrentStackWithElimination +import stack.simple.ConcurrentTreiberStack import kotlin.test.Test abstract class ConcurrentStackTests(private val stack: ConcurrentStack) { @@ -46,6 +48,6 @@ abstract class ConcurrentStackTests(private val stack: ConcurrentStack) { .check(this::class) } -//class ConcurrentStackWithEliminationTests : ConcurrentStackTests(ConcurrentTreiberStack()) +class ConcurrentTreiberStackTests : ConcurrentStackTests(ConcurrentTreiberStack()) -//class ConcurrentTreiberStackTests : ConcurrentStackTests(ConcurrentTreiberStack()) \ No newline at end of file +class ConcurrentStackWithEliminationTests : ConcurrentStackTests(ConcurrentStackWithElimination()) \ No newline at end of file