1 /* 2 * Copyright 2017-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. 3 */ 4 5 package internal_test1 6 7 import kotlinx.atomicfu.test.A 8 import kotlin.test.* 9 10 class B { 11 @Test testInternalnull12 fun testInternal() { 13 val a = A() 14 a.internalField.lazySet(true) 15 assertEquals(true, a.internalField.value) 16 check(a.internalField.getAndSet(false)) 17 assertEquals(false, a.internalField.value) 18 check(a.xxx.addAndGet(4) == 9) 19 assertEquals(9, a.xxx.value) 20 check(a.yyy.compareAndSet(638753975930025820, 3444)) 21 assertEquals(3444, a.yyy.value) 22 check(a.intArr[2].compareAndSet(0, 6)) 23 assertEquals(6, a.intArr[2].value) 24 check(a.refArr[3].compareAndSet(null, "OK")) 25 assertEquals("OK", a.refArr[3].value) 26 } 27 } 28 29 class D { 30 val da = A() 31 }