[ ] ~I've run .script/generate_boilerplate_files_with_gyb and included updated generated files in a commit of this pull request~
Motivation:
When building the tests for iOS and tvOS, the build fails because we are using APIs that aren't available on all platform versions. E.g.:
Tests/CryptoTests/Digests/DigestsTests.swift:117:37: error: 'blockByteCount' is only available in iOS 13.2 or newer
XCTAssertEqual(Insecure.MD5.blockByteCount, 64)
Modifications:
Add @available guard to test that uses blockByteCount API.
Update DataProtocol.hexString to not use String.init(unsafeUninitializedCapacity:initializingUTF8With:), which is only available on iOS 14+, and instead use Array.init(unsafeUninitializedCapacity:initializingWith:), which is available on older platforms.
Checklist
~If you've made changes to
gyb
files~.script/generate_boilerplate_files_with_gyb
and included updated generated files in a commit of this pull request~Motivation:
When building the tests for iOS and tvOS, the build fails because we are using APIs that aren't available on all platform versions. E.g.:
Modifications:
@available
guard to test that usesblockByteCount
API.DataProtocol.hexString
to not useString.init(unsafeUninitializedCapacity:initializingUTF8With:)
, which is only available on iOS 14+, and instead useArray.init(unsafeUninitializedCapacity:initializingWith:)
, which is available on older platforms.Result:
Tests can now build for and run on iOS and tvOS.