[K/N] Migrate some cinterop tests to new test infra
This commit is contained in:
committed by
Space Team
parent
22b2c1a587
commit
c5248fc5f4
+18
@@ -0,0 +1,18 @@
|
||||
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
|
||||
import arrayPointers.*
|
||||
import kotlin.test.*
|
||||
import kotlinx.cinterop.*
|
||||
|
||||
fun main() {
|
||||
arrayPointer = globalArray
|
||||
assertEquals(globalArray[0], arrayPointer!![0])
|
||||
arrayPointer!![0] = 15
|
||||
assertEquals(15, globalArray[0])
|
||||
|
||||
memScoped {
|
||||
val struct = alloc<StructWithArrayPtr>()
|
||||
struct.arrayPointer = globalArray
|
||||
assertEquals(globalArray[0], struct.arrayPointer!![0])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user