[K/N][Tests] Migrate framework and objcexport tests

^KT-61259
This commit is contained in:
Vladimir Sukharev
2024-01-22 20:12:14 +01:00
committed by Space Team
parent f00a145dd7
commit 025771460c
136 changed files with 698 additions and 416 deletions
@@ -0,0 +1,15 @@
---
enum E {
A, B, C
};
struct S {
int i;
float f;
};
struct S globalS = { .i = 3, .f = 3.14f };
enum E createEnum() {
return A;
}
@@ -0,0 +1,14 @@
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
import kt43517.*
fun produceEnum(): E =
createEnum()
fun compareEnums(e1: E, e2: E): Boolean =
e1 == e2
fun getFirstField(s: S): Int =
s.i
fun getGlobalS(): S =
globalS
@@ -0,0 +1,24 @@
import Foundation
import Kt43517
func testKt43517() throws {
try assertEquals(
actual: Kt43517Kt.compareEnums(e1: Kt43517Kt.produceEnum(), e2: Kt43517Kt.produceEnum()),
expected: true
)
try assertEquals(
actual: Kt43517Kt.getFirstField(s: Kt43517Kt.getGlobalS()),
expected: 3
)
}
class Kt43517Tests : TestProvider {
var tests: [TestCase] = []
init() {
providers.append(self)
tests = [
TestCase(name: "Kt43517", method: withAutorelease(testKt43517)),
]
}
}