From 7b592768754c569c049d96db5349674612c68c58 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sat, 30 Mar 2019 22:44:04 +0100 Subject: [PATCH] Comment out deprecated methods used in perf tests --- TunnelKitTests/DataManipulationTests.swift | 8 +-- TunnelKitTests/RawPerformanceTests.swift | 58 +++++++++++----------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/TunnelKitTests/DataManipulationTests.swift b/TunnelKitTests/DataManipulationTests.swift index 93fc455..4adc36d 100644 --- a/TunnelKitTests/DataManipulationTests.swift +++ b/TunnelKitTests/DataManipulationTests.swift @@ -56,10 +56,10 @@ class DataManipulationTests: XCTestCase { XCTAssertEqual(data.UInt16Value(from: 4), 0x6655) XCTAssertEqual(data.UInt32Value(from: 0), 0xbbaaff22) - XCTAssertEqual(data.UInt16Value(from: 3), data.UInt16ValueFromPointers(from: 3)) - XCTAssertEqual(data.UInt32Value(from: 2), data.UInt32ValueFromBuffer(from: 2)) - XCTAssertEqual(data.UInt16Value(from: 4), data.UInt16ValueFromPointers(from: 4)) - XCTAssertEqual(data.UInt32Value(from: 0), data.UInt32ValueFromBuffer(from: 0)) +// XCTAssertEqual(data.UInt16Value(from: 3), data.UInt16ValueFromPointers(from: 3)) +// XCTAssertEqual(data.UInt32Value(from: 2), data.UInt32ValueFromBuffer(from: 2)) +// XCTAssertEqual(data.UInt16Value(from: 4), data.UInt16ValueFromPointers(from: 4)) +// XCTAssertEqual(data.UInt32Value(from: 0), data.UInt32ValueFromBuffer(from: 0)) } func testZeroingData() { diff --git a/TunnelKitTests/RawPerformanceTests.swift b/TunnelKitTests/RawPerformanceTests.swift index cbfae27..04d87a9 100644 --- a/TunnelKitTests/RawPerformanceTests.swift +++ b/TunnelKitTests/RawPerformanceTests.swift @@ -61,27 +61,27 @@ class RawPerformanceTests: XCTestCase { } } - // 0.463s - func testUInt16FromPointers() { - let data = Data([0x22, 0xff, 0xaa, 0xbb, 0x55, 0x66]) - - measure { - for _ in 0..<1000000 { - let _ = data.UInt16ValueFromPointers(from: 3) - } - } - } - - // 0.863s - func testUInt32FromBuffer() { - let data = Data([0x22, 0xff, 0xaa, 0xbb, 0x55, 0x66]) - - measure { - for _ in 0..<1000000 { - let _ = data.UInt32ValueFromBuffer(from: 1) - } - } - } +// // 0.463s +// func testUInt16FromPointers() { +// let data = Data([0x22, 0xff, 0xaa, 0xbb, 0x55, 0x66]) +// +// measure { +// for _ in 0..<1000000 { +// let _ = data.UInt16ValueFromPointers(from: 3) +// } +// } +// } +// +// // 0.863s +// func testUInt32FromBuffer() { +// let data = Data([0x22, 0xff, 0xaa, 0xbb, 0x55, 0x66]) +// +// measure { +// for _ in 0..<1000000 { +// let _ = data.UInt32ValueFromBuffer(from: 1) +// } +// } +// } // 0.469s func testUInt32FromPointers() { @@ -94,14 +94,14 @@ class RawPerformanceTests: XCTestCase { } } - // 0.071s - func testRandomUInt32FromBuffer() { - measure { - for _ in 0..<10000 { - let _ = try! SecureRandom.uint32FromBuffer() - } - } - } +// // 0.071s +// func testRandomUInt32FromBuffer() { +// measure { +// for _ in 0..<10000 { +// let _ = try! SecureRandom.uint32FromBuffer() +// } +// } +// } // 0.063s func testRandomUInt32FromPointers() {