Skip to content

Commit

Permalink
Uncomment tests and add README.md sample
Browse files Browse the repository at this point in the history
  • Loading branch information
aartdem committed May 5, 2024
1 parent cb0b4ba commit 38b0ceb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Empty file added work1/README.md
Empty file.
1 change: 1 addition & 0 deletions work1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion work1/src/main/kotlin/stack/benchmark/StackBenchmark.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class StackBenchmark<T> {
}.map { it.toStackOperation() }

repeat(measureScenario.threadsNum) {
threads.add(thread(false) {
threads.add(thread(start = false) {
operations.forEach { it.invoke(measureScenario.initialStack) }
})
}
Expand Down
6 changes: 4 additions & 2 deletions work1/src/test/kotlin/stack/ConcurrentStackTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<Int>) {
Expand Down Expand Up @@ -46,6 +48,6 @@ abstract class ConcurrentStackTests(private val stack: ConcurrentStack<Int>) {
.check(this::class)
}

//class ConcurrentStackWithEliminationTests : ConcurrentStackTests(ConcurrentTreiberStack())
class ConcurrentTreiberStackTests : ConcurrentStackTests(ConcurrentTreiberStack())

//class ConcurrentTreiberStackTests : ConcurrentStackTests(ConcurrentTreiberStack())
class ConcurrentStackWithEliminationTests : ConcurrentStackTests(ConcurrentStackWithElimination())

0 comments on commit 38b0ceb

Please sign in to comment.