Skip to content

Commit

Permalink
Update availability annotations in tests (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjbeaumont authored Dec 19, 2023
1 parent ed66091 commit 09f7a99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Tests/CryptoTests/Digests/DigestsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class DigestsTests: XCTestCase {
try orFail { try testHashFunctionImplementsCoW(hf: SHA512.self) }
}

@available(macOS 10.15, iOS 13.2, tvOS 13.2, watchOS 6.1, *)
func testBlockSizes() {
XCTAssertEqual(Insecure.MD5.blockByteCount, 64)
XCTAssertEqual(Insecure.SHA1.blockByteCount, 64)
Expand Down
5 changes: 3 additions & 2 deletions Tests/_CryptoExtrasTests/Utils/BytesUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extension DataProtocol {
var hexString: String {
get {
let hexLen = self.count * 2
return String.init(unsafeUninitializedCapacity: hexLen) { buf in
let bytes = Array(unsafeUninitializedCapacity: hexLen) { buf, count in
var offset = 0

self.regions.forEach { (_) in
Expand All @@ -70,8 +70,9 @@ extension DataProtocol {
offset += 1
}
}
return offset
count = offset
}
return String(decoding: bytes, as: UTF8.self)
}
}
}
Expand Down

0 comments on commit 09f7a99

Please sign in to comment.