[K/N][Tests] Migrate objcSmoke & objcTests tests
^KT-61259
This commit is contained in:
committed by
Space Team
parent
58f7dd1c83
commit
524f0d335e
@@ -0,0 +1,19 @@
|
||||
@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
|
||||
|
||||
import kotlinx.cinterop.*
|
||||
import kotlin.native.concurrent.*
|
||||
import objcTests.*
|
||||
|
||||
fun Worker.runInWorker(block: () -> Unit) {
|
||||
block.freeze()
|
||||
val future = this.execute(TransferMode.SAFE, { block }) {
|
||||
it()
|
||||
}
|
||||
future.result // Throws on failure.
|
||||
}
|
||||
|
||||
fun nsArrayOf(vararg elements: Any): NSArray = NSMutableArray().apply {
|
||||
elements.forEach {
|
||||
this.addObject(it as ObjCObject)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user