Skip to content

Commit 522dc45

Browse files
committed
Add test for CURLINFO_CAPATH and CURLINFO_CAINFO
1 parent 9a045e8 commit 522dc45

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
package io.ktor.client.engine.curl.test
6+
7+
import kotlinx.cinterop.*
8+
import libcurl.curl_easy_cleanup
9+
import libcurl.curl_easy_getinfo
10+
import libcurl.curl_easy_init
11+
import kotlin.test.Test
12+
13+
@OptIn(ExperimentalForeignApi::class)
14+
class CurlSettingsTest {
15+
16+
@Test
17+
fun `test CURLINFO_CAPATH and CURLINFO_CAINFO`() = memScoped {
18+
val curl = curl_easy_init()
19+
20+
val caPath = allocPointerTo<ByteVar>()
21+
curl_easy_getinfo(curl, libcurl.CURLINFO_CAPATH, caPath.ptr)
22+
println("CURLINFO_CAPATH: " + caPath.value?.toKString())
23+
24+
val caInfo = allocPointerTo<ByteVar>()
25+
curl_easy_getinfo(curl, libcurl.CURLINFO_CAINFO, caInfo.ptr)
26+
println("CURLINFO_CAINFO:" + caInfo.value?.toKString())
27+
28+
curl_easy_cleanup(curl)
29+
}
30+
}

0 commit comments

Comments
 (0)