Closed ndkoval closed 4 months ago
The best option (if it works) would be transforming classes via a special java agent.
Hello, I am still getting the error when running with model check, even with the JVM options set. I was using the sample code from the official doc.
class Counter<T> {
// The following line will generate the error
private val size = AtomicInteger(0)
@Volatile
private var value = 0
fun inc(): Int = ++value
fun get() = value
}
class BasicCounterTest {
private val c = Counter<Int>() // Initial state
// Operations on the Counter
@Operation
fun inc() = c.inc()
@Operation
fun get() = c.get()
@Test // JUnit
fun modelCheckingTest() = ModelCheckingOptions().check(this::class)
}
Fixed under #285 and #296
The current model checking implementation requires the following VM options to be added:
We can overcome this restriction by transforming classes via a dynamically attached Java agent. See #249.
Subtasks to do:
beforeMethodCall[1,2,3,..]
optimizations - 0.5d