kotlinx.atomicfu JVM/IR compiler plugin support

Merge-request: KT-MR-6541
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
This commit is contained in:
mvicsokolova
2022-06-26 07:17:06 +00:00
committed by Space
parent eaad75fd52
commit 8053746ae0
62 changed files with 4249 additions and 349 deletions
@@ -2,32 +2,31 @@ import kotlinx.atomicfu.*
import kotlin.test.*
class LockFreeStackTest {
fun testClear() {
val s = LockFreeStack<String>()
check(s.isEmpty())
assertTrue(s.isEmpty())
s.pushLoop("A")
check(!s.isEmpty())
assertTrue(!s.isEmpty())
s.clear()
check(s.isEmpty())
assertTrue(s.isEmpty())
}
fun testPushPopLoop() {
val s = LockFreeStack<String>()
check(s.isEmpty())
assertTrue(s.isEmpty())
s.pushLoop("A")
check(!s.isEmpty())
check(s.popLoop() == "A")
check(s.isEmpty())
assertTrue(!s.isEmpty())
assertEquals("A", s.popLoop())
assertTrue(s.isEmpty())
}
fun testPushPopUpdate() {
val s = LockFreeStack<String>()
check(s.isEmpty())
assertTrue(s.isEmpty())
s.pushUpdate("A")
check(!s.isEmpty())
check(s.popUpdate() == "A")
check(s.isEmpty())
assertTrue(!s.isEmpty())
assertEquals("A", s.popUpdate())
assertTrue(s.isEmpty())
}
}