-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minimization improvement: try to remove two operations and move opera…
…tions to init and post parts (#350)
- Loading branch information
Showing
4 changed files
with
227 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/jvm/test/org/jetbrains/kotlinx/lincheck_test/representation/ConcurrentLinkedDequeTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Lincheck | ||
* | ||
* Copyright (C) 2019 - 2024 JetBrains s.r.o. | ||
* | ||
* This Source Code Form is subject to the terms of the | ||
* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed | ||
* with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package org.jetbrains.kotlinx.lincheck_test.representation | ||
|
||
import org.jetbrains.kotlinx.lincheck.* | ||
import org.jetbrains.kotlinx.lincheck.annotations.* | ||
import org.jetbrains.kotlinx.lincheck.strategy.managed.modelchecking.* | ||
import org.jetbrains.kotlinx.lincheck_test.util.* | ||
import org.junit.* | ||
import java.util.concurrent.* | ||
|
||
class ConcurrentLinkedDequeTest { | ||
private val deque = ConcurrentLinkedDeque<Int>() | ||
|
||
@Operation | ||
fun addFirst(e: Int) = deque.addFirst(e) | ||
|
||
@Operation | ||
fun addLast(e: Int) = deque.addLast(e) | ||
|
||
@Operation | ||
fun pollFirst() = deque.pollFirst() | ||
|
||
@Operation | ||
fun pollLast() = deque.pollLast() | ||
|
||
@Operation | ||
fun peekFirst() = deque.peekFirst() | ||
|
||
@Operation | ||
fun peekLast() = deque.peekLast() | ||
|
||
@Test | ||
fun modelCheckingTest() = ModelCheckingOptions().checkImpl(this::class.java) { failure -> | ||
failure.checkLincheckOutput("concurrent_linked_deque.txt") | ||
} | ||
} |
Oops, something went wrong.