[K/N] Migrate misc runtime/ tests to new testing infra ^KT-61259

This commit is contained in:
Alexander Shabalin
2023-10-30 11:47:39 +01:00
committed by Space Team
parent 364dcd30c8
commit fd1579186f
7 changed files with 170 additions and 179 deletions
@@ -0,0 +1,32 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package test.native.ref
import kotlin.native.ref.WeakReference
import kotlin.test.*
class WeakReferenceTest {
@Test
fun string() {
val v = "Hello"
val weak = WeakReference(v)
assertEquals(v, weak.value)
}
@Test
fun int() {
val v = 0
val weak = WeakReference(v)
assertEquals(0, weak.value)
}
@Test
fun long() {
val v = Long.MAX_VALUE
val weak = WeakReference(v)
assertEquals(Long.MAX_VALUE, weak.value)
}
}