Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for watchOS 6.0.0+ #227

Merged
merged 7 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import CFNetwork
import Foundation
import os.log

Expand Down Expand Up @@ -195,18 +194,23 @@ extension Code {
static func fromURLSessionCode(_ code: Int) -> Self {
// https://developer.apple.com/documentation/cfnetwork/cfnetworkerrors?language=swift
switch Int32(code) {
case CFNetworkErrors.cfurlErrorUnknown.rawValue:
// CFNetworkErrors.cfurlErrorUnknown.rawValue
case -998:
scottybobandy marked this conversation as resolved.
Show resolved Hide resolved
return .unknown
case CFNetworkErrors.cfurlErrorCancelled.rawValue:
// CFNetworkErrors.cfurlErrorCancelled.rawValue
case -999:
return .canceled
case CFNetworkErrors.cfurlErrorBadURL.rawValue:
// CFNetworkErrors.cfurlErrorBadURL.rawValue
case -1_000:
return .invalidArgument
case CFNetworkErrors.cfurlErrorTimedOut.rawValue:
// CFNetworkErrors.cfurlErrorTimedOut.rawValue
case -1_001:
return .deadlineExceeded
case CFNetworkErrors.cfurlErrorUnsupportedURL.rawValue:
// CFNetworkErrors.cfurlErrorUnsupportedURL.rawValue
case -1_002:
return .unimplemented
// URLSession can return errors in this range
case ...100:
// URLSession can return errors in this range
return .unknown
default:
return Code.fromHTTPStatus(code)
Expand Down
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ let package = Package(
.iOS(.v12),
.macOS(.v10_15),
.tvOS(.v13),
.watchOS(.v6)
],
products: [
.library(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ final class CallbackConformanceTests: XCTestCase {
}
}

@available(macOS 13, *) // Runtime support for parameterized protocol types requires macOS 13
// Minimum requirements for runtime support for parameterized protocol types
@available(iOS 16, *)
@available(macOS 13, *)
@available(tvOS 16, *)
@available(watchOS 9, *)
Comment on lines +183 to +186
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional attributes added for minimum requirements to run the test suite on targets other than macOS.

func testPingPong() {
func createPayload(
requestSize: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
import SwiftProtobuf
import XCTest

@available(iOS 16, *)
@available(tvOS 16, *)
@available(watchOS 9, *)
final class InterceptorIntegrationTests: XCTestCase {
func testUnaryInterceptorSuccess() async {
let trackedSteps = Locked([InterceptorStep]())
Expand Down