Fix routing tests

Broken in 7a278dba69
This commit is contained in:
Davide De Rosa 2020-05-24 00:40:16 +02:00
parent e4588745b5
commit bb40404a51
1 changed files with 12 additions and 4 deletions

View File

@ -102,7 +102,9 @@ class RoutingTests: XCTestCase {
let v6 = RoutingTableEntry(iPv6Network: "abcd:efef:120::/46", gateway: nil, networkInterface: "en0")
let v6Boundary = RoutingTableEntry(iPv6Network: "abcd:efef:120::/127", gateway: nil, networkInterface: "en0")
let v4parts = v4.partitioned()
guard let v4parts = v4.partitioned() else {
fatalError()
}
let v4parts1 = v4parts[0]
let v4parts2 = v4parts[1]
XCTAssertEqual(v4parts1.network(), "192.168.1.0")
@ -110,7 +112,9 @@ class RoutingTests: XCTestCase {
XCTAssertEqual(v4parts2.network(), "192.168.1.128")
XCTAssertEqual(v4parts2.prefix(), 25)
let v6parts = v6.partitioned()
guard let v6parts = v6.partitioned() else {
fatalError()
}
let v6parts1 = v6parts[0]
let v6parts2 = v6parts[1]
XCTAssertEqual(v6parts1.network(), "abcd:efef:120::")
@ -118,7 +122,9 @@ class RoutingTests: XCTestCase {
XCTAssertEqual(v6parts2.network(), "abcd:efef:122::")
XCTAssertEqual(v6parts2.prefix(), 47)
let v4BoundaryParts = v4Boundary.partitioned()
guard let v4BoundaryParts = v4Boundary.partitioned() else {
fatalError()
}
let v4BoundaryParts1 = v4BoundaryParts[0]
let v4BoundaryParts2 = v4BoundaryParts[1]
XCTAssertEqual(v4BoundaryParts1.network(), "192.168.1.0")
@ -126,7 +132,9 @@ class RoutingTests: XCTestCase {
XCTAssertEqual(v4BoundaryParts2.network(), "192.168.1.1")
XCTAssertEqual(v4BoundaryParts2.prefix(), 32)
let v6BoundaryParts = v6Boundary.partitioned()
guard let v6BoundaryParts = v6Boundary.partitioned() else {
fatalError()
}
let v6BoundaryParts1 = v6BoundaryParts[0]
let v6BoundaryParts2 = v6BoundaryParts[1]
XCTAssertEqual(v6BoundaryParts1.network(), "abcd:efef:120::")