[K/N] Migrate some cinterop tests to new test infra

This commit is contained in:
Vladimir Sukharev
2023-12-01 11:18:27 +01:00
committed by Space Team
parent 22b2c1a587
commit c5248fc5f4
47 changed files with 295 additions and 176 deletions
@@ -0,0 +1,9 @@
#ifdef __cplusplus
extern "C" {
#endif
const char* name();
#ifdef __cplusplus
}
#endif
@@ -0,0 +1,8 @@
#include <string>
#include "auxiliarySources.aux.h"
static std::string _name = "Hello from C++";
const char* name() {
return _name.c_str();
}
@@ -0,0 +1,2 @@
# The def file is empty intentianally
# `auxiliarySources.aux.h` is meant to be included via `-header` option of cinterop tool
@@ -0,0 +1,9 @@
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
import auxiliarySources.*
import kotlin.test.*
import kotlinx.cinterop.*
fun main() {
assertEquals(name()!!.toKString(), "Hello from C++")
}