mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Update tests
This commit is contained in:
@@ -6,22 +6,15 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import NetworkExtension
|
import NetworkExtension
|
||||||
|
@testable import OpenVPNAdapter
|
||||||
|
|
||||||
class CustomFlow: NEPacketTunnelFlow {
|
class CustomFlow: NSObject, OpenVPNAdapterPacketFlow {
|
||||||
|
|
||||||
override func readPackets(completionHandler: @escaping ([Data], [NSNumber]) -> Void) {
|
func readPackets(completionHandler: @escaping ([Data], [NSNumber]) -> Void) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func writePackets(_ packets: [Data], withProtocols protocols: [NSNumber]) -> Bool {
|
func writePackets(_ packets: [Data], withProtocols protocols: [NSNumber]) -> Bool {
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override func readPacketObjects(completionHandler: @escaping ([NEPacket]) -> Void) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
override func writePacketObjects(_ packets: [NEPacket]) -> Bool {
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ class OpenVPNAdapterTests: XCTestCase {
|
|||||||
|
|
||||||
extension OpenVPNAdapterTests: OpenVPNAdapterDelegate {
|
extension OpenVPNAdapterTests: OpenVPNAdapterDelegate {
|
||||||
|
|
||||||
func openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, configureTunnelWithNetworkSettings networkSettings: NEPacketTunnelNetworkSettings, completionHandler: @escaping (NEPacketTunnelFlow?) -> Void) {
|
func openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, configureTunnelWithNetworkSettings networkSettings: NEPacketTunnelNetworkSettings, completionHandler: @escaping (OpenVPNAdapterPacketFlow?) -> Void) {
|
||||||
completionHandler(customFlow)
|
completionHandler(customFlow)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user