Skip to content

Commit a74d684

Browse files
author
cham-s
committed
Update SSLTestHelpers, remove deprecation warnings in tests
1 parent 253a28e commit a74d684

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Tests/WebSocketKitTests/SSLTestHelpers.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func generateRSAPrivateKey() -> OpaquePointer {
7676
precondition(generateRC == 1)
7777

7878
let pkey = CNIOBoringSSL_EVP_PKEY_new()!
79-
let assignRC = CNIOBoringSSL_EVP_PKEY_assign(pkey, EVP_PKEY_RSA, rsa)
79+
let assignRC = CNIOBoringSSL_EVP_PKEY_assign_RSA(pkey, rsa)
8080

8181
precondition(assignRC == 1)
8282
return pkey
@@ -125,7 +125,7 @@ func generateSelfSignedCert(keygenFunction: () -> OpaquePointer = generateRSAPri
125125
NID_commonName,
126126
MBSTRING_UTF8,
127127
UnsafeMutablePointer(mutating: pointer),
128-
CInt(commonName.lengthOfBytes(using: .utf8)),
128+
ossl_ssize_t(commonName.lengthOfBytes(using: .utf8)),
129129
-1,
130130
0)
131131
}

Tests/WebSocketKitTests/WebSocketKitTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ final class WebSocketKitTests: XCTestCase {
516516
return XCTFail("couldn't get port from \(String(reflecting: server.localAddress))")
517517
}
518518
WebSocket.connect(to: "ws://localhost:\(port)", on: self.elg) { ws in
519-
ws.onPong {
520-
$0.close(promise: closePromise)
519+
ws.onPong { webSocket, _ in
520+
webSocket.close(promise: closePromise)
521521
promise.succeed()
522522
}
523523
ws.sendPing()
@@ -536,8 +536,8 @@ final class WebSocketKitTests: XCTestCase {
536536
}
537537
WebSocket.connect(to: "ws://localhost:\(port)", on: self.elg) { ws in
538538
ws.pingInterval = .milliseconds(100)
539-
ws.onPong {
540-
$0.close(promise: closePromise)
539+
ws.onPong { webSocket, _ in
540+
webSocket.close(promise: closePromise)
541541
promise.succeed()
542542
}
543543
}.cascadeFailure(to: closePromise)

0 commit comments

Comments
 (0)