From 59a72ad09661c09511a5916a5c524c6210161279 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Tue, 10 Oct 2023 17:41:30 -0500 Subject: [PATCH] [AltTests] Fixes compiler errors --- AltTests/TestErrors.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/AltTests/TestErrors.swift b/AltTests/TestErrors.swift index c3171c5a..02728df0 100644 --- a/AltTests/TestErrors.swift +++ b/AltTests/TestErrors.swift @@ -31,7 +31,7 @@ enum TestErrorCode: Int, ALTErrorEnum, CaseIterable } } -extension TestError +extension DefaultLocalizedError { static var allErrors: [TestError] { return Code.allCases.map { TestError($0) } @@ -70,12 +70,16 @@ extension VerificationError static var testErrors: [VerificationError] { let app = ALTApplication(fileURL: Bundle.main.bundleURL)! - return VerificationError.Code.allCases.map { code -> VerificationError in + return VerificationError.Code.allCases.compactMap { code -> VerificationError? in switch code { - case .privateEntitlements: return VerificationError.privateEntitlements(["dynamic-codesigning": true], app: app) case .mismatchedBundleIdentifiers: return VerificationError.mismatchedBundleIdentifiers(sourceBundleID: "com.rileytestut.App", app: app) case .iOSVersionNotSupported: return VerificationError.iOSVersionNotSupported(app: app, requiredOSVersion: OperatingSystemVersion(majorVersion: 21, minorVersion: 1, patchVersion: 0)) + case .mismatchedHash: return VerificationError.mismatchedHash("12345", expectedHash: "67890", app: app) + case .mismatchedVersion: return VerificationError.mismatchedVersion("1.0", expectedVersion: "1.1", app: app) + case .mismatchedBuildVersion: return VerificationError.mismatchedBuildVersion("1", expectedVersion: "28", app: app) + case .undeclaredPermissions: return VerificationError.undeclaredPermissions([ALTEntitlement.appGroups, ALTAppPrivacyPermission.bluetooth], app: app) + case .addedPermissions: return nil //VerificationError.addedPermissions([ALTAppPrivacyPermission.appleMusic, ALTEntitlement.interAppAudio], appVersion: app) } } } @@ -219,7 +223,6 @@ extension OperationError { case .unknown: return .unknown() case .unknownResult: return .unknownResult - case .cancelled: return .cancelled case .timedOut: return .timedOut case .notAuthenticated: return .notAuthenticated case .appNotFound: return .appNotFound(name: "Delta") @@ -233,6 +236,7 @@ extension OperationError case .serverNotFound: return .serverNotFound case .connectionFailed: return .connectionFailed case .connectionDropped: return .connectionDropped + case .forbidden: return .forbidden() } } }