[K/N] Migrate some cinterop tests to new test infra
This commit is contained in:
committed by
Space Team
parent
22b2c1a587
commit
c5248fc5f4
+9
@@ -0,0 +1,9 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
const char* name();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
#include <string>
|
||||
#include "auxiliarySources.aux.h"
|
||||
|
||||
static std::string _name = "Hello from C++";
|
||||
|
||||
const char* name() {
|
||||
return _name.c_str();
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
# The def file is empty intentianally
|
||||
# `auxiliarySources.aux.h` is meant to be included via `-header` option of cinterop tool
|
||||
+9
@@ -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++")
|
||||
}
|
||||
Reference in New Issue
Block a user