jvmTest.io.github.vinccool96.ref.JVMWearReferenceTest.kt Maven / Gradle / Ivy
package io.github.vinccool96.ref
import kotlin.test.Test
import kotlin.test.assertNotNull
import kotlin.test.assertNull
@Suppress("UNUSED_VALUE")
class JVMWearReferenceTest {
@Test
fun testGetGC() {
var obj: Any? = Any()
val ref = WeakReferenceFactory.createWeakRef(obj)
assertNotNull(ref.get())
obj = null
System.gc()
assertNull(ref.get())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy