Skip to content

Commit

Permalink
Add tests for PacketTunnelActor
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Petersson authored and buggmagnet committed Oct 10, 2023
1 parent 3bed86d commit 6d2ed0d
Show file tree
Hide file tree
Showing 13 changed files with 394 additions and 152 deletions.
92 changes: 46 additions & 46 deletions ios/MullvadVPN.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Actor+Public.swift
// PacketTunnelActor+Public.swift
// PacketTunnelCore
//
// Created by pronebird on 27/09/2023.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Actor.swift
// PacketTunnelActor.swift
// PacketTunnel
//
// Created by pronebird on 30/06/2023.
Expand Down
6 changes: 5 additions & 1 deletion ios/PacketTunnelCore/Actor/State.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ import class WireGuardKitTypes.PrivateKey
`.connecting`, `.reconnecting`, `.error` can be interrupted if the tunnel is requested to stop, which should segue actor towards `.disconnected` state.

*/
public enum State {
public enum State: Equatable {
public static func == (lhs: State, rhs: State) -> Bool {
lhs.name == rhs.name
}

/// Initial state at the time when actor is initialized but before the first connection attempt.
case initial

Expand Down
102 changes: 0 additions & 102 deletions ios/PacketTunnelCoreTests/ActorTests.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DefaultPathObserverFake: DefaultPathObserverProtocol {
private var innerPath: NetworkPath = NetworkPathStub()
private var stateLock = NSLock()

private var defaultPathHandler: ((NetworkPath) -> Void)?
var defaultPathHandler: ((NetworkPath) -> Void)?

func start(_ body: @escaping (NetworkPath) -> Void) {
stateLock.withLock {
Expand Down
Loading

0 comments on commit 6d2ed0d

Please sign in to comment.