Skip to content

Commit 2785fee

Browse files
committed
Fix MinGW and Linux unit tests
1 parent b6a491c commit 2785fee

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

sqllin-driver/src/linuxTest/kotlin/com/ctrip/sqllin/driver/PlatformLinux.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.ctrip.sqllin.driver
1818

19+
import kotlinx.cinterop.ExperimentalForeignApi
1920
import kotlinx.cinterop.toKString
2021
import platform.posix.getcwd
2122

@@ -24,5 +25,6 @@ import platform.posix.getcwd
2425
* @author yaqiao
2526
*/
2627

28+
@OptIn(ExperimentalForeignApi::class)
2729
actual fun getPlatformStringPath(): String =
28-
getcwd(null, 0)?.toKString() ?: throw IllegalStateException("The temp path created error")
30+
getcwd(null, 0u)?.toKString() ?: throw IllegalStateException("The temp path created error")

sqllin-driver/src/mingwTest/kotlin/com/ctrip/sqllin/driver/PlatformMingw.kt

+1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ import platform.posix._wgetcwd
2525
* @author yaqiao
2626
*/
2727

28+
@OptIn(ExperimentalForeignApi::class)
2829
actual fun getPlatformStringPath(): String =
2930
_wgetcwd(null, 0)?.toKString() ?: throw IllegalStateException("Get database path wrong")

sqllin-dsl/src/linuxTest/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.ctrip.sqllin.dsl
1818

19+
import kotlinx.cinterop.ExperimentalForeignApi
1920
import kotlinx.cinterop.toKString
2021
import platform.posix.getcwd
2122

@@ -24,7 +25,8 @@ import platform.posix.getcwd
2425
* @author yaqiao
2526
*/
2627

28+
@OptIn(ExperimentalForeignApi::class)
2729
actual fun getPlatformStringPath(): String =
28-
getcwd(null, 0)?.toKString() ?: throw IllegalStateException("The temp path created error")
30+
getcwd(null, 0u)?.toKString() ?: throw IllegalStateException("The temp path created error")
2931

3032
actual val pathSeparator: Char = '/'

sqllin-dsl/src/mingwTest/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import platform.posix._wgetcwd
2525
* @author yaqiao
2626
*/
2727

28+
@OptIn(ExperimentalForeignApi::class)
2829
actual fun getPlatformStringPath(): String =
2930
_wgetcwd(null, 0)?.toKString() ?: throw IllegalStateException("Get database path wrong")
3031

0 commit comments

Comments
 (0)