From c302414af7621bc9588f35dcfa3f125e66fada08 Mon Sep 17 00:00:00 2001 From: Corey Date: Mon, 15 Nov 2021 21:41:13 -0500 Subject: [PATCH 1/2] fix: overload QueryConstraint to accept Pointer --- CHANGELOG.md | 8 +++- Sources/ParseSwift/ParseConstants.swift | 2 +- Sources/ParseSwift/Types/Query.swift | 36 +++++++++----- Tests/ParseSwiftTests/ParseQueryTests.swift | 53 +++++++++++++++++++++ 4 files changed, 86 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8613648f6..cad556f1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,15 @@ ### main -[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.4...main) +[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.5...main) * _Contributing to this repo? Add info about your change here to be included in the next release_ +### 2.2.5 +[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.4...2.2.5) + +__Fixes__ +- Overload QueryConstraint to accept Pointer ([#281](https://github.com/parse-community/Parse-Swift/pull/281)), thanks to [Corey Baker](https://github.com/cbaker6). + ### 2.2.4 [Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.3...2.2.4) diff --git a/Sources/ParseSwift/ParseConstants.swift b/Sources/ParseSwift/ParseConstants.swift index d64a3015e..da7992380 100644 --- a/Sources/ParseSwift/ParseConstants.swift +++ b/Sources/ParseSwift/ParseConstants.swift @@ -10,7 +10,7 @@ import Foundation enum ParseConstants { static let sdk = "swift" - static let version = "2.2.4" + static let version = "2.2.5" static let fileManagementDirectory = "parse/" static let fileManagementPrivateDocumentsDirectory = "Private Documents/" static let fileManagementLibraryDirectory = "Library/" diff --git a/Sources/ParseSwift/Types/Query.swift b/Sources/ParseSwift/Types/Query.swift index 6b971b141..209272d68 100644 --- a/Sources/ParseSwift/Types/Query.swift +++ b/Sources/ParseSwift/Types/Query.swift @@ -126,19 +126,20 @@ public func == (key: String, value: T) -> QueryConstraint where T: Encodable - parameter key: The key that the value is stored in. - parameter value: The `ParseObject` to compare. - returns: The same instance of `QueryConstraint` as the receiver. + - throws: An error of type `ParseError`. */ public func == (key: String, value: T) throws -> QueryConstraint where T: ParseObject { - let constraint: QueryConstraint! - do { - constraint = try QueryConstraint(key: key, value: value.toPointer()) - } catch { - guard let parseError = error as? ParseError else { - throw ParseError(code: .unknownError, - message: error.localizedDescription) - } - throw parseError - } - return constraint + try QueryConstraint(key: key, value: value.toPointer()) +} + +/** + Add a constraint that requires that a key is equal to a `Pointer`. + - parameter key: The key that the value is stored in. + - parameter value: The `Pointer` to compare. + - returns: The same instance of `QueryConstraint` as the receiver. + */ +public func == (key: String, value: Pointer) -> QueryConstraint where T: ParseObject { + QueryConstraint(key: key, value: value) } /** @@ -587,6 +588,19 @@ internal struct RelatedCondition : Encodable where T: ParseObject { - parameter key: The key that should be related. - parameter object: The object that should be related. - returns: The same instance of `Query` as the receiver. + - throws: An error of type `ParseError`. + */ +public func related (key: String, object: T) throws -> QueryConstraint where T: ParseObject { + let pointer = try object.toPointer() + let condition = RelatedCondition(object: pointer, key: key) + return .init(key: QueryConstraint.Comparator.relatedTo.rawValue, value: condition) +} + +/** + Add a constraint that requires a key is related. + - parameter key: The key that should be related. + - parameter object: The pointer object that should be related. + - returns: The same instance of `Query` as the receiver. */ public func related (key: String, object: Pointer) -> QueryConstraint where T: ParseObject { let condition = RelatedCondition(object: object, key: key) diff --git a/Tests/ParseSwiftTests/ParseQueryTests.swift b/Tests/ParseSwiftTests/ParseQueryTests.swift index 32548a3b9..60b09d0ea 100644 --- a/Tests/ParseSwiftTests/ParseQueryTests.swift +++ b/Tests/ParseSwiftTests/ParseQueryTests.swift @@ -1128,6 +1128,16 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length let expected = "GameScore ({\"limit\":100,\"skip\":0,\"_method\":\"GET\",\"where\":{\"yolo\":{\"__type\":\"Pointer\",\"className\":\"GameScore\",\"objectId\":\"hello\"}}})" XCTAssertEqual(query.debugDescription, expected) } + + func testWhereKeyEqualToParseObjectPointer() throws { + var compareObject = GameScore(score: 11) + compareObject.objectId = "hello" + let pointer = try compareObject.toPointer() + let query = GameScore.query("yolo" == pointer) + // swiftlint:disable:next line_length + let expected = "GameScore ({\"limit\":100,\"skip\":0,\"_method\":\"GET\",\"where\":{\"yolo\":{\"__type\":\"Pointer\",\"className\":\"GameScore\",\"objectId\":\"hello\"}}})" + XCTAssertEqual(query.debugDescription, expected) + } #endif func testWhereKeyNotEqualTo() { @@ -1863,6 +1873,49 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length } func testWhereKeyRelated() throws { + let expected: [String: AnyCodable] = [ + "$relatedTo": [ + "key": "yolo", + "object": ["__type": "Pointer", + "className": "GameScore", + "objectId": "hello"] + ] + ] + var object = GameScore(score: 50) + object.objectId = "hello" + let constraint = try related(key: "yolo", object: object) + let query = GameScore.query(constraint) + let queryWhere = query.`where` + + do { + let encoded = try ParseCoding.jsonEncoder().encode(queryWhere) + let decodedDictionary = try JSONDecoder().decode([String: AnyCodable].self, from: encoded) + XCTAssertEqual(expected.keys, decodedDictionary.keys) + + guard let expectedValues = expected.values.first?.value as? [String: Any], + let expectedKey = expectedValues["key"] as? String, + let expectedObject = expectedValues["object"] as? [String: String] else { + XCTFail("Should have casted") + return + } + + guard let decodedValues = decodedDictionary.values.first?.value as? [String: Any], + let decodedKey = decodedValues["key"] as? String, + let decodedObject = decodedValues["object"] as? [String: String] else { + XCTFail("Should have casted") + return + } + + XCTAssertEqual(expectedKey, decodedKey) + XCTAssertEqual(expectedObject, decodedObject) + + } catch { + XCTFail(error.localizedDescription) + return + } + } + + func testWhereKeyRelatedPointer() throws { let expected: [String: AnyCodable] = [ "$relatedTo": [ "key": "yolo", From deea8f31f1743b2ad60a96e7d53ff355aed8ade9 Mon Sep 17 00:00:00 2001 From: Corey Date: Mon, 15 Nov 2021 21:56:55 -0500 Subject: [PATCH 2/2] Compile for Windows --- CHANGELOG.md | 1 + Sources/ParseSwift/Extensions/URLCache.swift | 2 +- .../BaseParseInstallation.swift | 2 +- .../LiveQuery/LiveQuerySocket.swift | 2 +- .../LiveQuery/ParseLiveQuery+async.swift | 2 +- .../ParseSwift/LiveQuery/ParseLiveQuery.swift | 2 +- .../Protocols/LiveQuerySocketDelegate.swift | 2 +- .../Protocols/ParseLiveQueryDelegate.swift | 2 +- .../Objects/ParseInstallation.swift | 8 ++-- Sources/ParseSwift/Objects/ParseUser.swift | 8 ++-- Sources/ParseSwift/Parse.swift | 8 ++-- Sources/ParseSwift/ParseConstants.swift | 2 + .../ParseSwift/Storage/KeychainStore.swift | 2 +- .../ParseSwift/Storage/ParseFileManager.swift | 10 ++--- .../Storage/ParseKeyValueStore.swift | 2 +- Sources/ParseSwift/Types/ParseACL.swift | 4 +- Sources/ParseSwift/Types/ParseConfig.swift | 6 +-- Sources/ParseSwift/Types/ParseVersion.swift | 4 +- Tests/ParseSwiftTests/APICommandTests.swift | 2 +- .../AnyCodableTests/AnyCodableTests.swift | 2 +- .../AnyCodableTests/AnyEncodableTests.swift | 2 +- Tests/ParseSwiftTests/IOS13Tests.swift | 4 +- .../ParseSwiftTests/InitializeSDKTests.swift | 12 +++--- .../ParseSwiftTests/KeychainStoreTests.swift | 2 +- Tests/ParseSwiftTests/ParseACLTests.swift | 2 +- .../ParseSwiftTests/ParseAnalyticsTests.swift | 2 +- .../ParseAnanlyticsAsyncTests.swift | 4 +- .../ParseAnanlyticsCombineTests.swift | 2 +- .../ParseAnonymousAsyncTests.swift | 4 +- .../ParseAnonymousCombineTests.swift | 2 +- .../ParseSwiftTests/ParseAnonymousTests.swift | 4 +- .../ParseAppleAsyncTests.swift | 4 +- .../ParseAppleCombineTests.swift | 2 +- Tests/ParseSwiftTests/ParseAppleTests.swift | 2 +- .../ParseAuthenticationAsyncTests.swift | 4 +- .../ParseAuthenticationCombineTests.swift | 2 +- .../ParseAuthenticationTests.swift | 2 +- Tests/ParseSwiftTests/ParseBytesTests.swift | 4 +- .../ParseCloudAsyncTests.swift | 4 +- .../ParseCloudCombineTests.swift | 2 +- Tests/ParseSwiftTests/ParseCloudTests.swift | 4 +- .../ParseConfigAsyncTests.swift | 8 ++-- .../ParseConfigCombineTests.swift | 6 +-- Tests/ParseSwiftTests/ParseConfigTests.swift | 12 +++--- .../ParseEncoderTests/TestParseEncoder.swift | 10 ++--- Tests/ParseSwiftTests/ParseErrorTests.swift | 2 +- .../ParseFacebookAsyncTests.swift | 4 +- .../ParseFacebookCombineTests.swift | 2 +- .../ParseSwiftTests/ParseFacebookTests.swift | 2 +- .../ParseSwiftTests/ParseFileAsyncTests.swift | 4 +- .../ParseFileCombineTests.swift | 2 +- .../ParseFileManagerTests.swift | 2 +- Tests/ParseSwiftTests/ParseFileTests.swift | 6 +-- .../ParseSwiftTests/ParseGeoPointTests.swift | 4 +- .../ParseHealthAsyncTests.swift | 4 +- .../ParseHealthCombineTests.swift | 2 +- Tests/ParseSwiftTests/ParseHealthTests.swift | 2 +- .../ParseInstallationAsyncTests.swift | 8 ++-- .../ParseInstallationCombineTests.swift | 6 +-- .../ParseInstallationTests.swift | 20 +++++----- .../ParseSwiftTests/ParseLDAPAsyncTests.swift | 4 +- .../ParseLDAPCombineTests.swift | 2 +- Tests/ParseSwiftTests/ParseLDAPTests.swift | 2 +- .../ParseLiveQueryAsyncTests.swift | 4 +- .../ParseLiveQueryCombineTests.swift | 4 +- .../ParseSwiftTests/ParseLiveQueryTests.swift | 4 +- .../ParseObjectAsyncTests.swift | 4 +- .../ParseObjectBatchTests.swift | 14 +++---- .../ParseObjectCombineTests.swift | 2 +- .../ParseObjectCustomObjectIdTests.swift | 4 +- Tests/ParseSwiftTests/ParseObjectTests.swift | 14 +++---- .../ParseOperationAsyncTests.swift | 4 +- .../ParseOperationCombineTests.swift | 2 +- .../ParseSwiftTests/ParseOperationTests.swift | 6 +-- .../ParsePointerAsyncTests.swift | 4 +- .../ParsePointerCombineTests.swift | 2 +- Tests/ParseSwiftTests/ParsePointerTests.swift | 6 +-- Tests/ParseSwiftTests/ParsePolygonTests.swift | 4 +- .../ParseQueryAsyncTests.swift | 4 +- .../ParseQueryCombineTests.swift | 2 +- Tests/ParseSwiftTests/ParseQueryTests.swift | 24 +++++------ .../ParseSwiftTests/ParseRelationTests.swift | 4 +- Tests/ParseSwiftTests/ParseRoleTests.swift | 10 ++--- Tests/ParseSwiftTests/ParseSessionTests.swift | 4 +- .../ParseTwitterAsyncTests.swift | 4 +- .../ParseTwitterCombineTests.swift | 2 +- Tests/ParseSwiftTests/ParseTwitterTests.swift | 2 +- .../ParseSwiftTests/ParseUserAsyncTests.swift | 12 +++--- .../ParseUserCombineTests.swift | 10 ++--- Tests/ParseSwiftTests/ParseUserTests.swift | 40 +++++++++---------- Tests/ParseSwiftTests/ParseVersionTests.swift | 2 +- 91 files changed, 229 insertions(+), 226 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cad556f1e..29b8254b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ __Fixes__ - Overload QueryConstraint to accept Pointer ([#281](https://github.com/parse-community/Parse-Swift/pull/281)), thanks to [Corey Baker](https://github.com/cbaker6). +- Add checks to build for Windows ([#281](https://github.com/parse-community/Parse-Swift/pull/281)), thanks to [Corey Baker](https://github.com/cbaker6). ### 2.2.4 [Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.3...2.2.4) diff --git a/Sources/ParseSwift/Extensions/URLCache.swift b/Sources/ParseSwift/Extensions/URLCache.swift index ce523dac8..10edd6aad 100644 --- a/Sources/ParseSwift/Extensions/URLCache.swift +++ b/Sources/ParseSwift/Extensions/URLCache.swift @@ -21,7 +21,7 @@ internal extension URLCache { let parseCacheDirectory = "ParseCache" let diskURL = cacheURL.appendingPathComponent(parseCacheDirectory, isDirectory: true) if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) { - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) return URLCache(memoryCapacity: ParseSwift.configuration.cacheMemoryCapacity, diskCapacity: ParseSwift.configuration.cacheDiskCapacity, directory: diskURL) diff --git a/Sources/ParseSwift/InternalObjects/BaseParseInstallation.swift b/Sources/ParseSwift/InternalObjects/BaseParseInstallation.swift index 53e73217b..b7a39fa17 100644 --- a/Sources/ParseSwift/InternalObjects/BaseParseInstallation.swift +++ b/Sources/ParseSwift/InternalObjects/BaseParseInstallation.swift @@ -29,7 +29,7 @@ internal struct BaseParseInstallation: ParseInstallation { guard let installationId = Self.currentContainer.installationId, Self.currentContainer.currentInstallation?.installationId == installationId else { try? ParseStorage.shared.delete(valueFor: ParseStorage.Keys.currentInstallation) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try? KeychainStore.shared.delete(valueFor: ParseStorage.Keys.currentInstallation) #endif _ = Self.currentContainer diff --git a/Sources/ParseSwift/LiveQuery/LiveQuerySocket.swift b/Sources/ParseSwift/LiveQuery/LiveQuerySocket.swift index e8f521324..95f640d79 100644 --- a/Sources/ParseSwift/LiveQuery/LiveQuerySocket.swift +++ b/Sources/ParseSwift/LiveQuery/LiveQuerySocket.swift @@ -5,7 +5,7 @@ // Created by Corey Baker on 12/31/20. // Copyright © 2020 Parse Community. All rights reserved. // -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) import Foundation #if canImport(FoundationNetworking) import FoundationNetworking diff --git a/Sources/ParseSwift/LiveQuery/ParseLiveQuery+async.swift b/Sources/ParseSwift/LiveQuery/ParseLiveQuery+async.swift index a3b4f5325..6af99557b 100644 --- a/Sources/ParseSwift/LiveQuery/ParseLiveQuery+async.swift +++ b/Sources/ParseSwift/LiveQuery/ParseLiveQuery+async.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) diff --git a/Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift b/Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift index 0c4e9915c..a9a689554 100644 --- a/Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift +++ b/Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift @@ -5,7 +5,7 @@ // Created by Corey Baker on 1/2/21. // Copyright © 2021 Parse Community. All rights reserved. // -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) import Foundation #if canImport(FoundationNetworking) import FoundationNetworking diff --git a/Sources/ParseSwift/LiveQuery/Protocols/LiveQuerySocketDelegate.swift b/Sources/ParseSwift/LiveQuery/Protocols/LiveQuerySocketDelegate.swift index 9cfe75d93..72d2c77d8 100644 --- a/Sources/ParseSwift/LiveQuery/Protocols/LiveQuerySocketDelegate.swift +++ b/Sources/ParseSwift/LiveQuery/Protocols/LiveQuerySocketDelegate.swift @@ -5,7 +5,7 @@ // Created by Corey Baker on 1/4/21. // Copyright © 2021 Parse Community. All rights reserved. // -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) import Foundation #if canImport(FoundationNetworking) import FoundationNetworking diff --git a/Sources/ParseSwift/LiveQuery/Protocols/ParseLiveQueryDelegate.swift b/Sources/ParseSwift/LiveQuery/Protocols/ParseLiveQueryDelegate.swift index fcfce314d..1d3eaf1b5 100644 --- a/Sources/ParseSwift/LiveQuery/Protocols/ParseLiveQueryDelegate.swift +++ b/Sources/ParseSwift/LiveQuery/Protocols/ParseLiveQueryDelegate.swift @@ -5,7 +5,7 @@ // Created by Corey Baker on 1/4/21. // Copyright © 2021 Parse Community. All rights reserved. // -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) import Foundation #if canImport(FoundationNetworking) import FoundationNetworking diff --git a/Sources/ParseSwift/Objects/ParseInstallation.swift b/Sources/ParseSwift/Objects/ParseInstallation.swift index 661f3c3c1..14d641b7f 100644 --- a/Sources/ParseSwift/Objects/ParseInstallation.swift +++ b/Sources/ParseSwift/Objects/ParseInstallation.swift @@ -128,7 +128,7 @@ public extension ParseInstallation { get { guard let installationInMemory: CurrentInstallationContainer = try? ParseStorage.shared.get(valueFor: ParseStorage.Keys.currentInstallation) else { - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) guard let installationFromKeyChain: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation) else { @@ -191,14 +191,14 @@ public extension ParseInstallation { } internal static func saveCurrentContainerToKeychain() { - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try? KeychainStore.shared.set(Self.currentContainer, for: ParseStorage.Keys.currentInstallation) #endif } internal static func deleteCurrentContainerFromKeychain() { try? ParseStorage.shared.delete(valueFor: ParseStorage.Keys.currentInstallation) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try? KeychainStore.shared.delete(valueFor: ParseStorage.Keys.currentInstallation) #endif //Prepare new installation @@ -253,7 +253,7 @@ extension ParseInstallation { guard let appInfo = Bundle.main.infoDictionary else { return } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) #if TARGET_OS_MACCATALYST // If using an Xcode new enough to know about Mac Catalyst: // Mac Catalyst Apps use a prefix to the bundle ID. This should not be transmitted diff --git a/Sources/ParseSwift/Objects/ParseUser.swift b/Sources/ParseSwift/Objects/ParseUser.swift index 17486ddb2..7074c1474 100644 --- a/Sources/ParseSwift/Objects/ParseUser.swift +++ b/Sources/ParseSwift/Objects/ParseUser.swift @@ -103,7 +103,7 @@ public extension ParseUser { get { guard let currentUserInMemory: CurrentUserContainer = try? ParseStorage.shared.get(valueFor: ParseStorage.Keys.currentUser) else { - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) return try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser) #else return nil @@ -115,14 +115,14 @@ public extension ParseUser { } internal static func saveCurrentContainerToKeychain() { - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try? KeychainStore.shared.set(Self.currentContainer, for: ParseStorage.Keys.currentUser) #endif } internal static func deleteCurrentContainerFromKeychain() { try? ParseStorage.shared.delete(valueFor: ParseStorage.Keys.currentUser) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) if #available(macOS 10.15, iOS 13.0, macCatalyst 13.0, watchOS 6.0, tvOS 13.0, *) { URLSession.liveQuery.closeAll() } @@ -992,7 +992,7 @@ extension ParseUser { var mutableSelf = self if let currentUser = Self.current, currentUser.hasSameObjectId(as: mutableSelf) == true { - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) // swiftlint:disable:next line_length if let currentUserContainerInKeychain: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser), currentUserContainerInKeychain.currentUser?.email == mutableSelf.email { diff --git a/Sources/ParseSwift/Parse.swift b/Sources/ParseSwift/Parse.swift index 52b896569..4d3df792b 100644 --- a/Sources/ParseSwift/Parse.swift +++ b/Sources/ParseSwift/Parse.swift @@ -158,7 +158,7 @@ public struct ParseSwift { let oneNineEightSDKVersion = try ParseVersion("1.9.8") // All migrations from previous versions to current should occur here: - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) if previousSDKVersion < oneNineEightSDKVersion { // Old macOS Keychain can't be used because it's global to all apps. _ = KeychainStore.old @@ -200,7 +200,7 @@ public struct ParseSwift { } BaseParseInstallation.createNewInstallationIfNeeded() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) if configuration.migrateFromObjcSDK { if let identifier = Bundle.main.bundleIdentifier { let objcParseKeychain = KeychainStore(service: "\(identifier).com.parse.sdk") @@ -326,7 +326,7 @@ public struct ParseSwift { } static internal func deleteKeychainIfNeeded() { - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) // Clear items out of the Keychain on app first run. if UserDefaults.standard.object(forKey: ParseConstants.bundlePrefix) == nil { if Self.configuration.deleteKeychainIfNeeded == true { @@ -357,7 +357,7 @@ public struct ParseSwift { authentication: authentication) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) /** Delete the Parse iOS Objective-C SDK Keychain from the device. - note: ParseSwift uses a different Keychain. After migration, the iOS Objective-C SDK Keychain is no longer needed. diff --git a/Sources/ParseSwift/ParseConstants.swift b/Sources/ParseSwift/ParseConstants.swift index da7992380..ba503f8e3 100644 --- a/Sources/ParseSwift/ParseConstants.swift +++ b/Sources/ParseSwift/ParseConstants.swift @@ -29,5 +29,7 @@ enum ParseConstants { static let deviceType = "linux" #elseif os(Android) static let deviceType = "android" + #elseif os(Windows) + static let deviceType = "windows" #endif } diff --git a/Sources/ParseSwift/Storage/KeychainStore.swift b/Sources/ParseSwift/Storage/KeychainStore.swift index 64301c3d9..a75e86f83 100644 --- a/Sources/ParseSwift/Storage/KeychainStore.swift +++ b/Sources/ParseSwift/Storage/KeychainStore.swift @@ -11,7 +11,7 @@ import Foundation import Security #endif -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) func getKeychainQueryTemplate(forService service: String) -> [String: String] { var query = [String: String]() diff --git a/Sources/ParseSwift/Storage/ParseFileManager.swift b/Sources/ParseSwift/Storage/ParseFileManager.swift index 197ca61f5..29179f28b 100644 --- a/Sources/ParseSwift/Storage/ParseFileManager.swift +++ b/Sources/ParseSwift/Storage/ParseFileManager.swift @@ -12,7 +12,7 @@ import Foundation public struct ParseFileManager { private var defaultDirectoryAttributes: [FileAttributeKey: Any]? { - #if os(macOS) || os(Linux) || os(Android) + #if os(macOS) || os(Linux) || os(Android) || os(Windows) return nil #else return [.protectionKey: FileProtectionType.completeUntilFirstUserAuthentication] @@ -21,14 +21,14 @@ public struct ParseFileManager { private var defaultDataWritingOptions: Data.WritingOptions { var options = Data.WritingOptions.atomic - #if !os(macOS) && !os(Linux) && !os(Android) + #if !os(macOS) && !os(Linux) && !os(Android) && !os(Windows) options.insert(.completeFileProtectionUntilFirstUserAuthentication) #endif return options } private var localSandBoxDataDirectoryPath: URL? { - #if os(macOS) || os(Linux) || os(Android) + #if os(macOS) || os(Linux) || os(Android) || os(Windows) return self.defaultDataDirectoryPath #else // swiftlint:disable:next line_length @@ -51,7 +51,7 @@ public struct ParseFileManager { /// The default directory for storing Parse files. public var defaultDataDirectoryPath: URL? { - #if os(macOS) || os(Linux) || os(Android) + #if os(macOS) || os(Linux) || os(Android) || os(Windows) var directoryPath: String! let paths = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true) guard let directory = paths.first else { @@ -87,7 +87,7 @@ public struct ParseFileManager { /// Creates an instance of `ParseFileManager`. /// - returns: If an instance can't be created, nil is returned. public init?() { - #if os(Linux) || os(Android) + #if os(Linux) || os(Android) || os(Windows) let applicationId = ParseSwift.configuration.applicationId applicationIdentifier = "\(ParseConstants.bundlePrefix).\(applicationId)" #else diff --git a/Sources/ParseSwift/Storage/ParseKeyValueStore.swift b/Sources/ParseSwift/Storage/ParseKeyValueStore.swift index d7635e026..73bb634a7 100644 --- a/Sources/ParseSwift/Storage/ParseKeyValueStore.swift +++ b/Sources/ParseSwift/Storage/ParseKeyValueStore.swift @@ -55,7 +55,7 @@ struct InMemoryKeyValueStore: ParseKeyValueStore { } } -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) // MARK: KeychainStore + ParseKeyValueStore extension KeychainStore: ParseKeyValueStore { diff --git a/Sources/ParseSwift/Types/ParseACL.swift b/Sources/ParseSwift/Types/ParseACL.swift index dd7bc0410..cbe5c279c 100644 --- a/Sources/ParseSwift/Types/ParseACL.swift +++ b/Sources/ParseSwift/Types/ParseACL.swift @@ -305,7 +305,7 @@ extension ParseACL { let aclController: DefaultACL? - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) aclController = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.defaultACL) #else aclController = try? ParseStorage.shared.get(valueFor: ParseStorage.Keys.defaultACL) @@ -385,7 +385,7 @@ extension ParseACL { useCurrentUser: withAccessForCurrentUser) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.set(aclController, for: ParseStorage.Keys.defaultACL) #else try ParseStorage.shared.set(aclController, for: ParseStorage.Keys.defaultACL) diff --git a/Sources/ParseSwift/Types/ParseConfig.swift b/Sources/ParseSwift/Types/ParseConfig.swift index 59d7ae4c6..d63ac37f1 100644 --- a/Sources/ParseSwift/Types/ParseConfig.swift +++ b/Sources/ParseSwift/Types/ParseConfig.swift @@ -137,7 +137,7 @@ public extension ParseConfig { get { guard let configInMemory: CurrentConfigContainer = try? ParseStorage.shared.get(valueFor: ParseStorage.Keys.currentConfig) else { - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) return try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentConfig) #else return nil @@ -160,14 +160,14 @@ public extension ParseConfig { } internal static func saveCurrentContainerToKeychain() { - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try? KeychainStore.shared.set(Self.currentContainer, for: ParseStorage.Keys.currentConfig) #endif } internal static func deleteCurrentContainerFromKeychain() { try? ParseStorage.shared.delete(valueFor: ParseStorage.Keys.currentConfig) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try? KeychainStore.shared.delete(valueFor: ParseStorage.Keys.currentConfig) #endif } diff --git a/Sources/ParseSwift/Types/ParseVersion.swift b/Sources/ParseSwift/Types/ParseVersion.swift index 4658313a8..6395e6578 100644 --- a/Sources/ParseSwift/Types/ParseVersion.swift +++ b/Sources/ParseSwift/Types/ParseVersion.swift @@ -18,7 +18,7 @@ public struct ParseVersion: Encodable { get { guard let versionInMemory: String = try? ParseStorage.shared.get(valueFor: ParseStorage.Keys.currentVersion) else { - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) guard let versionFromKeyChain: String = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentVersion) else { @@ -39,7 +39,7 @@ public struct ParseVersion: Encodable { } set { try? ParseStorage.shared.set(newValue, for: ParseStorage.Keys.currentVersion) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try? KeychainStore.shared.set(newValue, for: ParseStorage.Keys.currentVersion) #endif } diff --git a/Tests/ParseSwiftTests/APICommandTests.swift b/Tests/ParseSwiftTests/APICommandTests.swift index 00ca2d6f2..61faad42a 100644 --- a/Tests/ParseSwiftTests/APICommandTests.swift +++ b/Tests/ParseSwiftTests/APICommandTests.swift @@ -40,7 +40,7 @@ class APICommandTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/AnyCodableTests/AnyCodableTests.swift b/Tests/ParseSwiftTests/AnyCodableTests/AnyCodableTests.swift index 4aab01a8a..f295d0ec2 100755 --- a/Tests/ParseSwiftTests/AnyCodableTests/AnyCodableTests.swift +++ b/Tests/ParseSwiftTests/AnyCodableTests/AnyCodableTests.swift @@ -40,7 +40,7 @@ class AnyCodableTests: XCTestCase { } //Test has objective-c - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testJSONEncoding() { let dictionary: [String: AnyCodable] = [ "boolean": true, diff --git a/Tests/ParseSwiftTests/AnyCodableTests/AnyEncodableTests.swift b/Tests/ParseSwiftTests/AnyCodableTests/AnyEncodableTests.swift index 309da4e20..b3c7dd30e 100755 --- a/Tests/ParseSwiftTests/AnyCodableTests/AnyEncodableTests.swift +++ b/Tests/ParseSwiftTests/AnyCodableTests/AnyEncodableTests.swift @@ -2,7 +2,7 @@ import XCTest @testable import ParseSwift //Test has objective-c -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) class AnyEncodableTests: XCTestCase { func testJSONEncoding() { let dictionary: [String: AnyEncodable] = [ diff --git a/Tests/ParseSwiftTests/IOS13Tests.swift b/Tests/ParseSwiftTests/IOS13Tests.swift index 2d4926faf..7b7d646ac 100644 --- a/Tests/ParseSwiftTests/IOS13Tests.swift +++ b/Tests/ParseSwiftTests/IOS13Tests.swift @@ -68,7 +68,7 @@ class IOS13Tests: XCTestCase { // swiftlint:disable:this type_body_length override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -87,7 +87,7 @@ class IOS13Tests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation2], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testSaveCommand() throws { let score = GameScore(score: 10) let className = score.className diff --git a/Tests/ParseSwiftTests/InitializeSDKTests.swift b/Tests/ParseSwiftTests/InitializeSDKTests.swift index 5af8fac71..85cb246da 100644 --- a/Tests/ParseSwiftTests/InitializeSDKTests.swift +++ b/Tests/ParseSwiftTests/InitializeSDKTests.swift @@ -41,7 +41,7 @@ class InitializeSDKTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() if let identifier = Bundle.main.bundleIdentifier { try KeychainStore(service: "\(identifier).com.parse.sdk").deleteAll() @@ -51,7 +51,7 @@ class InitializeSDKTests: XCTestCase { try ParseStorage.shared.deleteAll() } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func addCachedResponse() { if URLSession.parse.configuration.urlCache == nil { URLSession.parse.configuration.urlCache = .init() @@ -168,7 +168,7 @@ class InitializeSDKTests: XCTestCase { } XCTAssertEqual(memoryInstallation.currentInstallation, currentInstallation) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) // Should be in Keychain guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation) else { @@ -179,7 +179,7 @@ class InitializeSDKTests: XCTestCase { #endif } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testFetchMissingCurrentInstallation() { let memory = InMemoryKeyValueStore() ParseStorage.shared.use(memory) @@ -270,7 +270,7 @@ class InitializeSDKTests: XCTestCase { XCTAssertNil(ParseSwift.sessionDelegate.authentication) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testDontOverwriteMigratedInstallation() throws { guard let url = URL(string: "http://localhost:1337/1") else { XCTFail("Should create valid URL") @@ -456,7 +456,7 @@ class InitializeSDKTests: XCTestCase { XCTAssertNotNil(installation.installationId) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testMigrateOldKeychainToNew() throws { var user = BaseParseUser() user.objectId = "wow" diff --git a/Tests/ParseSwiftTests/KeychainStoreTests.swift b/Tests/ParseSwiftTests/KeychainStoreTests.swift index 85f5e4647..e6bebdce6 100644 --- a/Tests/ParseSwiftTests/KeychainStoreTests.swift +++ b/Tests/ParseSwiftTests/KeychainStoreTests.swift @@ -5,7 +5,7 @@ // Created by Florent Vilmart on 17-09-25. // Copyright © 2020 Parse Community. All rights reserved. // -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift diff --git a/Tests/ParseSwiftTests/ParseACLTests.swift b/Tests/ParseSwiftTests/ParseACLTests.swift index 441a8f5ce..1e2b827eb 100644 --- a/Tests/ParseSwiftTests/ParseACLTests.swift +++ b/Tests/ParseSwiftTests/ParseACLTests.swift @@ -27,7 +27,7 @@ class ParseACLTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseAnalyticsTests.swift b/Tests/ParseSwiftTests/ParseAnalyticsTests.swift index 4ef9f3e12..9d522d618 100644 --- a/Tests/ParseSwiftTests/ParseAnalyticsTests.swift +++ b/Tests/ParseSwiftTests/ParseAnalyticsTests.swift @@ -28,7 +28,7 @@ class ParseAnalyticsTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseAnanlyticsAsyncTests.swift b/Tests/ParseSwiftTests/ParseAnanlyticsAsyncTests.swift index 247a1cee8..28dbee3f3 100644 --- a/Tests/ParseSwiftTests/ParseAnanlyticsAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseAnanlyticsAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -29,7 +29,7 @@ class ParseAnanlyticsAsyncTests: XCTestCase { // swiftlint:disable:this type_bod override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseAnanlyticsCombineTests.swift b/Tests/ParseSwiftTests/ParseAnanlyticsCombineTests.swift index 2e442ae85..1a745152d 100644 --- a/Tests/ParseSwiftTests/ParseAnanlyticsCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseAnanlyticsCombineTests.swift @@ -31,7 +31,7 @@ class ParseAnanlyticsCombineTests: XCTestCase { // swiftlint:disable:this type_b override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseAnonymousAsyncTests.swift b/Tests/ParseSwiftTests/ParseAnonymousAsyncTests.swift index d63848065..0270e2a59 100644 --- a/Tests/ParseSwiftTests/ParseAnonymousAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseAnonymousAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -75,7 +75,7 @@ class ParseAnonymousAsyncTests: XCTestCase { // swiftlint:disable:this type_body override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseAnonymousCombineTests.swift b/Tests/ParseSwiftTests/ParseAnonymousCombineTests.swift index 1811b3f97..38fae26a0 100644 --- a/Tests/ParseSwiftTests/ParseAnonymousCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseAnonymousCombineTests.swift @@ -77,7 +77,7 @@ class ParseAnonymousCombineTests: XCTestCase { // swiftlint:disable:this type_bo override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseAnonymousTests.swift b/Tests/ParseSwiftTests/ParseAnonymousTests.swift index 1e1ce344f..9aa4c0b03 100644 --- a/Tests/ParseSwiftTests/ParseAnonymousTests.swift +++ b/Tests/ParseSwiftTests/ParseAnonymousTests.swift @@ -81,7 +81,7 @@ class ParseAnonymousTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -499,7 +499,7 @@ class ParseAnonymousTests: XCTestCase { XCTAssertEqual(User.current?.updatedAt, becomeUpdatedAt) XCTAssertFalse(User.anonymous.isLinked) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser) else { diff --git a/Tests/ParseSwiftTests/ParseAppleAsyncTests.swift b/Tests/ParseSwiftTests/ParseAppleAsyncTests.swift index e4d768e6b..8acea3c27 100644 --- a/Tests/ParseSwiftTests/ParseAppleAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseAppleAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -76,7 +76,7 @@ class ParseAppleAsyncTests: XCTestCase { // swiftlint:disable:this type_body_len override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseAppleCombineTests.swift b/Tests/ParseSwiftTests/ParseAppleCombineTests.swift index bc0d26d41..39fe7279e 100644 --- a/Tests/ParseSwiftTests/ParseAppleCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseAppleCombineTests.swift @@ -78,7 +78,7 @@ class ParseAppleCombineTests: XCTestCase { // swiftlint:disable:this type_body_l override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseAppleTests.swift b/Tests/ParseSwiftTests/ParseAppleTests.swift index 317cbc942..507f2fa99 100644 --- a/Tests/ParseSwiftTests/ParseAppleTests.swift +++ b/Tests/ParseSwiftTests/ParseAppleTests.swift @@ -75,7 +75,7 @@ class ParseAppleTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseAuthenticationAsyncTests.swift b/Tests/ParseSwiftTests/ParseAuthenticationAsyncTests.swift index 9b73db762..ecce64c2c 100644 --- a/Tests/ParseSwiftTests/ParseAuthenticationAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseAuthenticationAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -129,7 +129,7 @@ class ParseAuthenticationAsyncTests: XCTestCase { // swiftlint:disable:this type override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseAuthenticationCombineTests.swift b/Tests/ParseSwiftTests/ParseAuthenticationCombineTests.swift index 59c195593..2b4ad63c5 100644 --- a/Tests/ParseSwiftTests/ParseAuthenticationCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseAuthenticationCombineTests.swift @@ -132,7 +132,7 @@ class ParseAuthenticationCombineTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseAuthenticationTests.swift b/Tests/ParseSwiftTests/ParseAuthenticationTests.swift index 91c079846..5a2e7e42d 100644 --- a/Tests/ParseSwiftTests/ParseAuthenticationTests.swift +++ b/Tests/ParseSwiftTests/ParseAuthenticationTests.swift @@ -132,7 +132,7 @@ class ParseAuthenticationTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseBytesTests.swift b/Tests/ParseSwiftTests/ParseBytesTests.swift index d38a47db1..3b07e03f7 100644 --- a/Tests/ParseSwiftTests/ParseBytesTests.swift +++ b/Tests/ParseSwiftTests/ParseBytesTests.swift @@ -26,7 +26,7 @@ class ParseBytesTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -39,7 +39,7 @@ class ParseBytesTests: XCTestCase { XCTAssertEqual(decoded, bytes) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testDebugString() { let bytes = ParseBytes(base64: "ZnJveW8=") let expected = "ParseBytes ({\"__type\":\"Bytes\",\"base64\":\"ZnJveW8=\"})" diff --git a/Tests/ParseSwiftTests/ParseCloudAsyncTests.swift b/Tests/ParseSwiftTests/ParseCloudAsyncTests.swift index 1401118ab..76affc20e 100644 --- a/Tests/ParseSwiftTests/ParseCloudAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseCloudAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -40,7 +40,7 @@ class ParseCloudAsyncTests: XCTestCase { // swiftlint:disable:this type_body_len override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseCloudCombineTests.swift b/Tests/ParseSwiftTests/ParseCloudCombineTests.swift index cd6b1bfed..f3a7a098c 100644 --- a/Tests/ParseSwiftTests/ParseCloudCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseCloudCombineTests.swift @@ -42,7 +42,7 @@ class ParseCloudCombineTests: XCTestCase { // swiftlint:disable:this type_body_l override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseCloudTests.swift b/Tests/ParseSwiftTests/ParseCloudTests.swift index b05842150..51339d398 100644 --- a/Tests/ParseSwiftTests/ParseCloudTests.swift +++ b/Tests/ParseSwiftTests/ParseCloudTests.swift @@ -56,7 +56,7 @@ class ParseCloudTests: XCTestCase { // swiftlint:disable:this type_body_length override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -99,7 +99,7 @@ class ParseCloudTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertEqual(decoded, expected, "\"functionJobName\" key should be skipped by ParseEncoder") } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testDebugString() { let cloud = Cloud2(functionJobName: "test", customKey: "parse") let expected = "{\"customKey\":\"parse\",\"functionJobName\":\"test\"}" diff --git a/Tests/ParseSwiftTests/ParseConfigAsyncTests.swift b/Tests/ParseSwiftTests/ParseConfigAsyncTests.swift index f93aff9d2..0c3c7bd3a 100644 --- a/Tests/ParseSwiftTests/ParseConfigAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseConfigAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -84,7 +84,7 @@ class ParseConfigAsyncTests: XCTestCase { // swiftlint:disable:this type_body_le override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -136,7 +136,7 @@ class ParseConfigAsyncTests: XCTestCase { // swiftlint:disable:this type_body_le XCTAssertEqual(fetched.welcomeMessage, configOnServer.welcomeMessage) XCTAssertEqual(Config.current?.welcomeMessage, configOnServer.welcomeMessage) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainConfig: CurrentConfigContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentConfig) else { @@ -171,7 +171,7 @@ class ParseConfigAsyncTests: XCTestCase { // swiftlint:disable:this type_body_le XCTAssertTrue(saved) XCTAssertEqual(Config.current?.welcomeMessage, config.welcomeMessage) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainConfig: CurrentConfigContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentConfig) else { diff --git a/Tests/ParseSwiftTests/ParseConfigCombineTests.swift b/Tests/ParseSwiftTests/ParseConfigCombineTests.swift index 63b45bded..4a8b4c82a 100644 --- a/Tests/ParseSwiftTests/ParseConfigCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseConfigCombineTests.swift @@ -86,7 +86,7 @@ class ParseConfigCombineTests: XCTestCase { // swiftlint:disable:this type_body_ override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -148,7 +148,7 @@ class ParseConfigCombineTests: XCTestCase { // swiftlint:disable:this type_body_ XCTAssertEqual(fetched.welcomeMessage, configOnServer.welcomeMessage) XCTAssertEqual(Config.current?.welcomeMessage, configOnServer.welcomeMessage) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainConfig: CurrentConfigContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentConfig) else { @@ -197,7 +197,7 @@ class ParseConfigCombineTests: XCTestCase { // swiftlint:disable:this type_body_ XCTAssertTrue(saved) XCTAssertEqual(Config.current?.welcomeMessage, config.welcomeMessage) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainConfig: CurrentConfigContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentConfig) else { diff --git a/Tests/ParseSwiftTests/ParseConfigTests.swift b/Tests/ParseSwiftTests/ParseConfigTests.swift index 37f165ecf..e644d4d11 100644 --- a/Tests/ParseSwiftTests/ParseConfigTests.swift +++ b/Tests/ParseSwiftTests/ParseConfigTests.swift @@ -83,7 +83,7 @@ class ParseConfigTests: XCTestCase { // swiftlint:disable:this type_body_length override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -144,7 +144,7 @@ class ParseConfigTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertNil(command.body) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testDebugString() { var config = Config() config.welcomeMessage = "Hello" @@ -183,7 +183,7 @@ class ParseConfigTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertEqual(fetched.welcomeMessage, configOnServer.welcomeMessage) XCTAssertEqual(Config.current?.welcomeMessage, configOnServer.welcomeMessage) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainConfig: CurrentConfigContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentConfig) else { @@ -225,7 +225,7 @@ class ParseConfigTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertEqual(fetched.welcomeMessage, configOnServer.welcomeMessage) XCTAssertEqual(Config.current?.welcomeMessage, configOnServer.welcomeMessage) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainConfig: CurrentConfigContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentConfig) else { @@ -276,7 +276,7 @@ class ParseConfigTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertTrue(saved) XCTAssertEqual(Config.current?.welcomeMessage, config.welcomeMessage) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainConfig: CurrentConfigContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentConfig) else { @@ -316,7 +316,7 @@ class ParseConfigTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertTrue(saved) XCTAssertEqual(Config.current?.welcomeMessage, config.welcomeMessage) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainConfig: CurrentConfigContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentConfig) else { diff --git a/Tests/ParseSwiftTests/ParseEncoderTests/TestParseEncoder.swift b/Tests/ParseSwiftTests/ParseEncoderTests/TestParseEncoder.swift index ff14f4891..9fa19e758 100644 --- a/Tests/ParseSwiftTests/ParseEncoderTests/TestParseEncoder.swift +++ b/Tests/ParseSwiftTests/ParseEncoderTests/TestParseEncoder.swift @@ -62,7 +62,7 @@ class TestParseEncoder: XCTestCase { _testRoundTrip(of: address) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testEncodingTopLevelStructuredClass() { // Person is a class with multiple fields. let expectedJSON = "{\"name\":\"Johnny Appleseed\",\"email\":\"appleseed@apple.com\"}".data(using: .utf8)! @@ -102,7 +102,7 @@ class TestParseEncoder: XCTestCase { _testRoundTrip(of: EnhancedBool.fileNotFound, expectedJSON: "null".data(using: .utf8)!) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testEncodingMultipleNestedContainersWithTheSameTopLevelKey() { struct Model: Codable, Equatable { let first: String @@ -202,7 +202,7 @@ class TestParseEncoder: XCTestCase { }*/ // MARK: - Output Formatting Tests - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testEncodingOutputFormattingDefault() { let expectedJSON = "{\"name\":\"Johnny Appleseed\",\"email\":\"appleseed@apple.com\"}".data(using: .utf8)! let person = Person.testValue @@ -233,7 +233,7 @@ class TestParseEncoder: XCTestCase { }*/ // MARK: - Date Strategy Tests - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) // Disabled for now till we resolve rdar://52618414 func x_testEncodingDate() throws { @@ -897,7 +897,7 @@ class TestParseEncoder: XCTestCase { _testRoundTripTypeCoercionFailure(of: [0.0, 1.0] as [Double], as: [Bool].self) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testDecodingConcreteTypeParameter() { let encoder = ParseEncoder() guard let json = try? encoder.encode(Employee.testValue) else { diff --git a/Tests/ParseSwiftTests/ParseErrorTests.swift b/Tests/ParseSwiftTests/ParseErrorTests.swift index b229d1edf..e18bcc41c 100644 --- a/Tests/ParseSwiftTests/ParseErrorTests.swift +++ b/Tests/ParseSwiftTests/ParseErrorTests.swift @@ -28,7 +28,7 @@ class ParseErrorTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseFacebookAsyncTests.swift b/Tests/ParseSwiftTests/ParseFacebookAsyncTests.swift index b4befd105..9483ef0a3 100644 --- a/Tests/ParseSwiftTests/ParseFacebookAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseFacebookAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -76,7 +76,7 @@ class ParseFacebookAsyncTests: XCTestCase { // swiftlint:disable:this type_body_ override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseFacebookCombineTests.swift b/Tests/ParseSwiftTests/ParseFacebookCombineTests.swift index 9416e1cd8..7ff7e9441 100644 --- a/Tests/ParseSwiftTests/ParseFacebookCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseFacebookCombineTests.swift @@ -78,7 +78,7 @@ class ParseFacebookCombineTests: XCTestCase { // swiftlint:disable:this type_bod override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseFacebookTests.swift b/Tests/ParseSwiftTests/ParseFacebookTests.swift index 8ae6e536f..139fd03c0 100644 --- a/Tests/ParseSwiftTests/ParseFacebookTests.swift +++ b/Tests/ParseSwiftTests/ParseFacebookTests.swift @@ -75,7 +75,7 @@ class ParseFacebookTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseFileAsyncTests.swift b/Tests/ParseSwiftTests/ParseFileAsyncTests.swift index b13bd245f..28f6ebdc9 100644 --- a/Tests/ParseSwiftTests/ParseFileAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseFileAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -40,7 +40,7 @@ class ParseFileAsyncTests: XCTestCase { // swiftlint:disable:this type_body_leng override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseFileCombineTests.swift b/Tests/ParseSwiftTests/ParseFileCombineTests.swift index 2c1283fe1..73c504174 100644 --- a/Tests/ParseSwiftTests/ParseFileCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseFileCombineTests.swift @@ -42,7 +42,7 @@ class ParseFileCombineTests: XCTestCase { // swiftlint:disable:this type_body_le override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseFileManagerTests.swift b/Tests/ParseSwiftTests/ParseFileManagerTests.swift index 56bac7319..ddf8f7bc6 100644 --- a/Tests/ParseSwiftTests/ParseFileManagerTests.swift +++ b/Tests/ParseSwiftTests/ParseFileManagerTests.swift @@ -39,7 +39,7 @@ class ParseFileManagerTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseFileTests.swift b/Tests/ParseSwiftTests/ParseFileTests.swift index 7862f2b13..24d7353c5 100644 --- a/Tests/ParseSwiftTests/ParseFileTests.swift +++ b/Tests/ParseSwiftTests/ParseFileTests.swift @@ -44,7 +44,7 @@ class ParseFileTests: XCTestCase { // swiftlint:disable:this type_body_length try super.tearDownWithError() MockURLProtocol.removeAll() URLSession.parse.configuration.urlCache?.removeAllCachedResponses() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -193,7 +193,7 @@ class ParseFileTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertEqual(parseFile1, parseFile2, "no urls, but localIds shoud be the same") } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testDebugString() throws { guard let sampleData = "Hello World".data(using: .utf8) else { throw ParseError(code: .unknownError, message: "Should have converted to data") @@ -682,7 +682,7 @@ class ParseFileTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation1], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //URL Mocker is not able to mock this in linux and tests fail, so don't run. func testFetchFileCancelAsync() throws { diff --git a/Tests/ParseSwiftTests/ParseGeoPointTests.swift b/Tests/ParseSwiftTests/ParseGeoPointTests.swift index 344be9349..7b1548b87 100644 --- a/Tests/ParseSwiftTests/ParseGeoPointTests.swift +++ b/Tests/ParseSwiftTests/ParseGeoPointTests.swift @@ -29,7 +29,7 @@ class ParseGeoPointTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -67,7 +67,7 @@ class ParseGeoPointTests: XCTestCase { } } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testDebugString() throws { let point = try ParseGeoPoint(latitude: 10, longitude: 20) let expected = "ParseGeoPoint ({\"__type\":\"GeoPoint\",\"longitude\":20,\"latitude\":10})" diff --git a/Tests/ParseSwiftTests/ParseHealthAsyncTests.swift b/Tests/ParseSwiftTests/ParseHealthAsyncTests.swift index 729919a61..ca505596a 100644 --- a/Tests/ParseSwiftTests/ParseHealthAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseHealthAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -29,7 +29,7 @@ class ParseHealthAsyncTests: XCTestCase { // swiftlint:disable:this type_body_le override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseHealthCombineTests.swift b/Tests/ParseSwiftTests/ParseHealthCombineTests.swift index c78c43516..783246aa3 100644 --- a/Tests/ParseSwiftTests/ParseHealthCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseHealthCombineTests.swift @@ -30,7 +30,7 @@ class ParseHealthCombineTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseHealthTests.swift b/Tests/ParseSwiftTests/ParseHealthTests.swift index 2aa6cd99a..b95693d3b 100644 --- a/Tests/ParseSwiftTests/ParseHealthTests.swift +++ b/Tests/ParseSwiftTests/ParseHealthTests.swift @@ -28,7 +28,7 @@ class ParseHealthTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseInstallationAsyncTests.swift b/Tests/ParseSwiftTests/ParseInstallationAsyncTests.swift index 99bc4957d..659e95462 100644 --- a/Tests/ParseSwiftTests/ParseInstallationAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseInstallationAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -105,7 +105,7 @@ class ParseInstallationAsyncTests: XCTestCase { // swiftlint:disable:this type_b override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -316,7 +316,7 @@ class ParseInstallationAsyncTests: XCTestCase { // swiftlint:disable:this type_b } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation), @@ -388,7 +388,7 @@ class ParseInstallationAsyncTests: XCTestCase { // swiftlint:disable:this type_b } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation), diff --git a/Tests/ParseSwiftTests/ParseInstallationCombineTests.swift b/Tests/ParseSwiftTests/ParseInstallationCombineTests.swift index 89221cc77..6b0381f24 100644 --- a/Tests/ParseSwiftTests/ParseInstallationCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseInstallationCombineTests.swift @@ -106,7 +106,7 @@ class ParseInstallationCombineTests: XCTestCase { // swiftlint:disable:this type override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -378,7 +378,7 @@ class ParseInstallationCombineTests: XCTestCase { // swiftlint:disable:this type } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation), @@ -470,7 +470,7 @@ class ParseInstallationCombineTests: XCTestCase { // swiftlint:disable:this type } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation), diff --git a/Tests/ParseSwiftTests/ParseInstallationTests.swift b/Tests/ParseSwiftTests/ParseInstallationTests.swift index 82888a971..053fc70b9 100644 --- a/Tests/ParseSwiftTests/ParseInstallationTests.swift +++ b/Tests/ParseSwiftTests/ParseInstallationTests.swift @@ -100,7 +100,7 @@ class ParseInstallationTests: XCTestCase { // swiftlint:disable:this type_body_l override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -163,7 +163,7 @@ class ParseInstallationTests: XCTestCase { // swiftlint:disable:this type_body_l XCTAssertNotEqual(originalInstallation.deviceToken, Installation.current?.customKey) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testInstallationImmutableFieldsCannotBeChangedInMemory() { guard let originalInstallation = Installation.current, let originalInstallationId = originalInstallation.installationId, @@ -594,7 +594,7 @@ class ParseInstallationTests: XCTestCase { // swiftlint:disable:this type_body_l XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) //Should be updated in Keychain - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation), let keychainUpdatedCurrentDate = keychainInstallation.currentInstallation?.updatedAt else { @@ -676,7 +676,7 @@ class ParseInstallationTests: XCTestCase { // swiftlint:disable:this type_body_l } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation), @@ -839,7 +839,7 @@ class ParseInstallationTests: XCTestCase { // swiftlint:disable:this type_body_l } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation), @@ -928,7 +928,7 @@ class ParseInstallationTests: XCTestCase { // swiftlint:disable:this type_body_l } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation), @@ -1045,7 +1045,7 @@ class ParseInstallationTests: XCTestCase { // swiftlint:disable:this type_body_l } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation), @@ -1097,7 +1097,7 @@ class ParseInstallationTests: XCTestCase { // swiftlint:disable:this type_body_l } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation), @@ -1195,7 +1195,7 @@ class ParseInstallationTests: XCTestCase { // swiftlint:disable:this type_body_l return } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation), @@ -1255,7 +1255,7 @@ class ParseInstallationTests: XCTestCase { // swiftlint:disable:this type_body_l return } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainInstallation: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation), diff --git a/Tests/ParseSwiftTests/ParseLDAPAsyncTests.swift b/Tests/ParseSwiftTests/ParseLDAPAsyncTests.swift index 99bc4c29e..4d8b42af7 100644 --- a/Tests/ParseSwiftTests/ParseLDAPAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseLDAPAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -76,7 +76,7 @@ class ParseLDAPAsyncTests: XCTestCase { // swiftlint:disable:this type_body_leng override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseLDAPCombineTests.swift b/Tests/ParseSwiftTests/ParseLDAPCombineTests.swift index 12ba2053c..bdc11b1b9 100644 --- a/Tests/ParseSwiftTests/ParseLDAPCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseLDAPCombineTests.swift @@ -78,7 +78,7 @@ class ParseLDAPCombineTests: XCTestCase { // swiftlint:disable:this type_body_le override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseLDAPTests.swift b/Tests/ParseSwiftTests/ParseLDAPTests.swift index b6f357311..5795a1165 100644 --- a/Tests/ParseSwiftTests/ParseLDAPTests.swift +++ b/Tests/ParseSwiftTests/ParseLDAPTests.swift @@ -75,7 +75,7 @@ class ParseLDAPTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseLiveQueryAsyncTests.swift b/Tests/ParseSwiftTests/ParseLiveQueryAsyncTests.swift index 01a9c4bd4..536cb0204 100644 --- a/Tests/ParseSwiftTests/ParseLiveQueryAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseLiveQueryAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -30,7 +30,7 @@ class ParseLiveQueryAsyncTests: XCTestCase { // swiftlint:disable:this type_body override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseLiveQueryCombineTests.swift b/Tests/ParseSwiftTests/ParseLiveQueryCombineTests.swift index fabcb8f3a..78350696a 100644 --- a/Tests/ParseSwiftTests/ParseLiveQueryCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseLiveQueryCombineTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -33,7 +33,7 @@ class ParseLiveQueryCombineTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseLiveQueryTests.swift b/Tests/ParseSwiftTests/ParseLiveQueryTests.swift index 700526124..339426386 100644 --- a/Tests/ParseSwiftTests/ParseLiveQueryTests.swift +++ b/Tests/ParseSwiftTests/ParseLiveQueryTests.swift @@ -5,7 +5,7 @@ // Created by Corey Baker on 1/3/21. // Copyright © 2021 Parse Community. All rights reserved. // -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -65,7 +65,7 @@ class ParseLiveQueryTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseObjectAsyncTests.swift b/Tests/ParseSwiftTests/ParseObjectAsyncTests.swift index af3f69435..999656bef 100644 --- a/Tests/ParseSwiftTests/ParseObjectAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseObjectAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -58,7 +58,7 @@ class ParseObjectAsyncTests: XCTestCase { // swiftlint:disable:this type_body_le override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseObjectBatchTests.swift b/Tests/ParseSwiftTests/ParseObjectBatchTests.swift index dfcf75449..ca4ba2d36 100644 --- a/Tests/ParseSwiftTests/ParseObjectBatchTests.swift +++ b/Tests/ParseSwiftTests/ParseObjectBatchTests.swift @@ -51,14 +51,14 @@ class ParseObjectBatchTests: XCTestCase { // swiftlint:disable:this type_body_le override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() } //COREY: Linux decodes this differently for some reason - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testSaveAllCommand() throws { let score = GameScore(score: 10) let score2 = GameScore(score: 20) @@ -274,7 +274,7 @@ class ParseObjectBatchTests: XCTestCase { // swiftlint:disable:this type_body_le } } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testUpdateAllCommand() throws { var score = GameScore(score: 10) var score2 = GameScore(score: 20) @@ -747,7 +747,7 @@ class ParseObjectBatchTests: XCTestCase { // swiftlint:disable:this type_body_le wait(for: [expectation1, expectation2], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeSaveAllAsync() { let score = GameScore(score: 10) let score2 = GameScore(score: 20) @@ -959,7 +959,7 @@ class ParseObjectBatchTests: XCTestCase { // swiftlint:disable:this type_body_le wait(for: [expectation1, expectation2], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeUpdateAllAsync() { var score = GameScore(score: 10) score.objectId = "yarr" @@ -1224,7 +1224,7 @@ class ParseObjectBatchTests: XCTestCase { // swiftlint:disable:this type_body_le wait(for: [expectation1], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeFetchAllAsync() { let score = GameScore(score: 10) let score2 = GameScore(score: 20) @@ -1370,7 +1370,7 @@ class ParseObjectBatchTests: XCTestCase { // swiftlint:disable:this type_body_le } } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testDeleteAllError() { let parseError = ParseError(code: .objectNotFound, message: "Object not found") let response = [BatchResponseItem(success: nil, error: parseError), diff --git a/Tests/ParseSwiftTests/ParseObjectCombineTests.swift b/Tests/ParseSwiftTests/ParseObjectCombineTests.swift index 96c649809..bbb8e245d 100644 --- a/Tests/ParseSwiftTests/ParseObjectCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseObjectCombineTests.swift @@ -57,7 +57,7 @@ class ParseObjectCombineTests: XCTestCase { // swiftlint:disable:this type_body_ override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseObjectCustomObjectIdTests.swift b/Tests/ParseSwiftTests/ParseObjectCustomObjectIdTests.swift index 048754f13..5b6ff1f37 100644 --- a/Tests/ParseSwiftTests/ParseObjectCustomObjectIdTests.swift +++ b/Tests/ParseSwiftTests/ParseObjectCustomObjectIdTests.swift @@ -128,7 +128,7 @@ class ParseObjectCustomObjectIdTests: XCTestCase { // swiftlint:disable:this typ override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -147,7 +147,7 @@ class ParseObjectCustomObjectIdTests: XCTestCase { // swiftlint:disable:this typ wait(for: [expectation2], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testSaveCommand() throws { let objectId = "yarr" var score = GameScore(score: 10) diff --git a/Tests/ParseSwiftTests/ParseObjectTests.swift b/Tests/ParseSwiftTests/ParseObjectTests.swift index a7e2b338f..dbce8e68c 100644 --- a/Tests/ParseSwiftTests/ParseObjectTests.swift +++ b/Tests/ParseSwiftTests/ParseObjectTests.swift @@ -221,7 +221,7 @@ class ParseObjectTests: XCTestCase { // swiftlint:disable:this type_body_length override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -467,7 +467,7 @@ class ParseObjectTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation1, expectation2], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeFetchAsync() { var score = GameScore(score: 10) let objectId = "yarr" @@ -523,7 +523,7 @@ class ParseObjectTests: XCTestCase { // swiftlint:disable:this type_body_length self.fetchAsync(score: score, scoreOnServer: scoreOnServer, callbackQueue: .main) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testSaveCommand() throws { let score = GameScore(score: 10) let className = score.className @@ -794,7 +794,7 @@ class ParseObjectTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation1, expectation2], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeSaveAsync() { let score = GameScore(score: 10) @@ -899,7 +899,7 @@ class ParseObjectTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation1, expectation2], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeUpdateAsync() { var score = GameScore(score: 10) score.objectId = "yarr" @@ -1066,7 +1066,7 @@ class ParseObjectTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation1, expectation2], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeDeleteAsync() { var score = GameScore(score: 10) let objectId = "yarr" @@ -1419,7 +1419,7 @@ class ParseObjectTests: XCTestCase { // swiftlint:disable:this type_body_length } } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) // swiftlint:disable:next function_body_length func testDeepSaveObjectWithFile() throws { var game = Game2() diff --git a/Tests/ParseSwiftTests/ParseOperationAsyncTests.swift b/Tests/ParseSwiftTests/ParseOperationAsyncTests.swift index 9e5c25002..993c79a1f 100644 --- a/Tests/ParseSwiftTests/ParseOperationAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseOperationAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -55,7 +55,7 @@ class ParseOperationAsyncTests: XCTestCase { // swiftlint:disable:this type_body override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseOperationCombineTests.swift b/Tests/ParseSwiftTests/ParseOperationCombineTests.swift index 93a217a41..2e009e4d1 100644 --- a/Tests/ParseSwiftTests/ParseOperationCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseOperationCombineTests.swift @@ -57,7 +57,7 @@ class ParseOperationCombineTests: XCTestCase { // swiftlint:disable:this type_bo override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseOperationTests.swift b/Tests/ParseSwiftTests/ParseOperationTests.swift index 39c40ffd6..144346613 100644 --- a/Tests/ParseSwiftTests/ParseOperationTests.swift +++ b/Tests/ParseSwiftTests/ParseOperationTests.swift @@ -73,13 +73,13 @@ class ParseOperationTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testSaveCommand() throws { var score = GameScore(score: 10) let objectId = "hello" @@ -297,7 +297,7 @@ class ParseOperationTests: XCTestCase { } //Linux decodes in different order - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testIncrement() throws { let score = GameScore(score: 10) let operations = score.operation diff --git a/Tests/ParseSwiftTests/ParsePointerAsyncTests.swift b/Tests/ParseSwiftTests/ParsePointerAsyncTests.swift index 01bd4a8cf..e4763aa34 100644 --- a/Tests/ParseSwiftTests/ParsePointerAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParsePointerAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -48,7 +48,7 @@ class ParsePointerAsyncTests: XCTestCase { // swiftlint:disable:this type_body_l override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParsePointerCombineTests.swift b/Tests/ParseSwiftTests/ParsePointerCombineTests.swift index 55acf0212..0637fb53c 100644 --- a/Tests/ParseSwiftTests/ParsePointerCombineTests.swift +++ b/Tests/ParseSwiftTests/ParsePointerCombineTests.swift @@ -49,7 +49,7 @@ class ParsePointerCombineTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParsePointerTests.swift b/Tests/ParseSwiftTests/ParsePointerTests.swift index e10c6fec7..ef012ef98 100644 --- a/Tests/ParseSwiftTests/ParsePointerTests.swift +++ b/Tests/ParseSwiftTests/ParsePointerTests.swift @@ -49,7 +49,7 @@ class ParsePointerTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -66,7 +66,7 @@ class ParsePointerTests: XCTestCase { XCTAssertEqual(pointer.objectId, initializedPointer.objectId) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testDebugString() throws { var score = GameScore(score: 10) score.objectId = "yarr" @@ -272,7 +272,7 @@ class ParsePointerTests: XCTestCase { wait(for: [expectation1, expectation2], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testEncodeEmbeddedPointer() throws { var score = GameScore(score: 10) let objectId = "yarr" diff --git a/Tests/ParseSwiftTests/ParsePolygonTests.swift b/Tests/ParseSwiftTests/ParsePolygonTests.swift index 151156d62..46d81f09d 100644 --- a/Tests/ParseSwiftTests/ParsePolygonTests.swift +++ b/Tests/ParseSwiftTests/ParsePolygonTests.swift @@ -39,7 +39,7 @@ class ParsePolygonTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -115,7 +115,7 @@ class ParsePolygonTests: XCTestCase { } } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testDebugString() throws { let polygon = try ParsePolygon(points) let expected = "ParsePolygon ({\"__type\":\"Polygon\",\"coordinates\":[[0,0],[0,1],[1,1],[1,0],[0,0]]})" diff --git a/Tests/ParseSwiftTests/ParseQueryAsyncTests.swift b/Tests/ParseSwiftTests/ParseQueryAsyncTests.swift index de2e3674a..3838ae7ed 100644 --- a/Tests/ParseSwiftTests/ParseQueryAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseQueryAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -62,7 +62,7 @@ class ParseQueryAsyncTests: XCTestCase { // swiftlint:disable:this type_body_len override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseQueryCombineTests.swift b/Tests/ParseSwiftTests/ParseQueryCombineTests.swift index 430e9a8b7..9d35430ea 100644 --- a/Tests/ParseSwiftTests/ParseQueryCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseQueryCombineTests.swift @@ -66,7 +66,7 @@ class ParseQueryCombineTests: XCTestCase { // swiftlint:disable:this type_body_l override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseQueryTests.swift b/Tests/ParseSwiftTests/ParseQueryTests.swift index 60b09d0ea..fe0ac32ac 100644 --- a/Tests/ParseSwiftTests/ParseQueryTests.swift +++ b/Tests/ParseSwiftTests/ParseQueryTests.swift @@ -65,7 +65,7 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -307,7 +307,7 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertEqual(query.`where`.constraints.values.count, 2) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testFindCommand() throws { let query = GameScore.query() let command = query.findCommand() @@ -444,7 +444,7 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeFindAsync() { var scoreOnServer = GameScore(score: 10) scoreOnServer.objectId = "yarr" @@ -657,7 +657,7 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testFirstCommand() throws { let query = GameScore.query() let command = query.firstCommand() @@ -734,7 +734,7 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length XCTFail("Should have casted as ParseError") return } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) // swiftlint:disable:next line_length XCTAssertEqual(error.message, "Invalid struct: No value associated with key CodingKeys(stringValue: \"score\", intValue: nil) (\"score\").") XCTAssertEqual(error.code, .unknownError) @@ -811,7 +811,7 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeFirstAsync() { var scoreOnServer = GameScore(score: 10) scoreOnServer.objectId = "yarr" @@ -854,7 +854,7 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length firstAsync(scoreOnServer: scoreOnServer, callbackQueue: .main) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeFirstAsyncNoObjectFound() { let scoreOnServer = GameScore(score: 10) let results = QueryResponse(results: [GameScore](), count: 0) @@ -905,7 +905,7 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testCountCommand() throws { let query = GameScore.query() let command = query.countCommand() @@ -982,7 +982,7 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeCountAsync() { var scoreOnServer = GameScore(score: 10) scoreOnServer.objectId = "yarr" @@ -1119,7 +1119,7 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertThrowsError(try GameScore.query("yolo" == compareObject)) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testWhereKeyEqualToParseObject() throws { var compareObject = GameScore(score: 11) compareObject.objectId = "hello" @@ -2037,7 +2037,7 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length } } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testWhereKeyNearGeoPointWithinMiles() throws { let expected: [String: AnyCodable] = [ "yolo": ["$nearSphere": ["latitude": 10, "longitude": 20, "__type": "GeoPoint"], @@ -2929,7 +2929,7 @@ class ParseQueryTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testAggregateCommand() throws { var query = GameScore.query() let value = AnyEncodable("world") diff --git a/Tests/ParseSwiftTests/ParseRelationTests.swift b/Tests/ParseSwiftTests/ParseRelationTests.swift index 9a9578e0d..7aa763c36 100644 --- a/Tests/ParseSwiftTests/ParseRelationTests.swift +++ b/Tests/ParseSwiftTests/ParseRelationTests.swift @@ -10,7 +10,7 @@ import Foundation import XCTest @testable import ParseSwift -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) class ParseRelationTests: XCTestCase { struct GameScore: ParseObject { //: These are required by ParseObject @@ -70,7 +70,7 @@ class ParseRelationTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseRoleTests.swift b/Tests/ParseSwiftTests/ParseRoleTests.swift index 50f345214..eeee80138 100644 --- a/Tests/ParseSwiftTests/ParseRoleTests.swift +++ b/Tests/ParseSwiftTests/ParseRoleTests.swift @@ -105,7 +105,7 @@ class ParseRoleTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -151,7 +151,7 @@ class ParseRoleTests: XCTestCase { XCTAssertThrowsError(try userRoles.add("level", objects: [user])) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testUserAddOperation() throws { var acl = ParseACL() acl.publicWrite = false @@ -203,7 +203,7 @@ class ParseRoleTests: XCTestCase { XCTAssertThrowsError(try userRoles.remove("level", objects: [user])) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testUserRemoveOperation() throws { var acl = ParseACL() acl.publicWrite = false @@ -242,7 +242,7 @@ class ParseRoleTests: XCTestCase { XCTAssertThrowsError(try roles.add("roles", objects: [level])) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testRoleAddIncorrectKeyError() throws { var acl = ParseACL() acl.publicWrite = false @@ -307,7 +307,7 @@ class ParseRoleTests: XCTestCase { XCTAssertThrowsError(try roles.remove("level", objects: [user])) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testRoleRemoveOperation() throws { var acl = ParseACL() acl.publicWrite = false diff --git a/Tests/ParseSwiftTests/ParseSessionTests.swift b/Tests/ParseSwiftTests/ParseSessionTests.swift index 43ef14f36..5027946b1 100644 --- a/Tests/ParseSwiftTests/ParseSessionTests.swift +++ b/Tests/ParseSwiftTests/ParseSessionTests.swift @@ -70,7 +70,7 @@ class ParseSessionTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -99,7 +99,7 @@ class ParseSessionTests: XCTestCase { XCTAssertEqual(session.endpoint.urlComponent, "/sessions/me") } -#if !os(Linux) && !os(Android) +#if !os(Linux) && !os(Android) && !os(Windows) func testURLSession() throws { let session = URLSession.parse XCTAssertNotNil(session.configuration.urlCache) diff --git a/Tests/ParseSwiftTests/ParseTwitterAsyncTests.swift b/Tests/ParseSwiftTests/ParseTwitterAsyncTests.swift index be0e8b09d..15724c04d 100644 --- a/Tests/ParseSwiftTests/ParseTwitterAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseTwitterAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -76,7 +76,7 @@ class ParseTwitterAsyncTests: XCTestCase { // swiftlint:disable:this type_body_l override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseTwitterCombineTests.swift b/Tests/ParseSwiftTests/ParseTwitterCombineTests.swift index 5b8a4746d..4a5995042 100644 --- a/Tests/ParseSwiftTests/ParseTwitterCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseTwitterCombineTests.swift @@ -78,7 +78,7 @@ class ParseTwitterCombineTests: XCTestCase { // swiftlint:disable:this type_body override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseTwitterTests.swift b/Tests/ParseSwiftTests/ParseTwitterTests.swift index 4c4b6913a..c02af11e9 100644 --- a/Tests/ParseSwiftTests/ParseTwitterTests.swift +++ b/Tests/ParseSwiftTests/ParseTwitterTests.swift @@ -75,7 +75,7 @@ class ParseTwitterTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() diff --git a/Tests/ParseSwiftTests/ParseUserAsyncTests.swift b/Tests/ParseSwiftTests/ParseUserAsyncTests.swift index 112828657..921843a70 100644 --- a/Tests/ParseSwiftTests/ParseUserAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseUserAsyncTests.swift @@ -6,7 +6,7 @@ // Copyright © 2021 Parse Community. All rights reserved. // -#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) +#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows) import Foundation import XCTest @testable import ParseSwift @@ -83,7 +83,7 @@ class ParseUserAsyncTests: XCTestCase { // swiftlint:disable:this type_body_leng override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -321,7 +321,7 @@ class ParseUserAsyncTests: XCTestCase { // swiftlint:disable:this type_body_leng XCTFail("Should have a new installation") } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) if let installationFromKeychain: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation) { if installationFromKeychain.installationId == oldInstallationId @@ -371,7 +371,7 @@ class ParseUserAsyncTests: XCTestCase { // swiftlint:disable:this type_body_leng XCTFail("Should have a new installation") } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) if let installationFromKeychain: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation) { if installationFromKeychain.installationId == oldInstallationId @@ -627,7 +627,7 @@ class ParseUserAsyncTests: XCTestCase { // swiftlint:disable:this type_body_leng } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser), @@ -700,7 +700,7 @@ class ParseUserAsyncTests: XCTestCase { // swiftlint:disable:this type_body_leng } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser), diff --git a/Tests/ParseSwiftTests/ParseUserCombineTests.swift b/Tests/ParseSwiftTests/ParseUserCombineTests.swift index 7684a8932..0d3a816f7 100644 --- a/Tests/ParseSwiftTests/ParseUserCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseUserCombineTests.swift @@ -84,7 +84,7 @@ class ParseUserCombineTests: XCTestCase { // swiftlint:disable:this type_body_le override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -375,7 +375,7 @@ class ParseUserCombineTests: XCTestCase { // swiftlint:disable:this type_body_le XCTFail("Should have a new installation") } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) if let installationFromKeychain: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation) { if installationFromKeychain.installationId == oldInstallationId @@ -438,7 +438,7 @@ class ParseUserCombineTests: XCTestCase { // swiftlint:disable:this type_body_le XCTFail("Should have a new installation") } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) if let installationFromKeychain: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation) { if installationFromKeychain.installationId == oldInstallationId @@ -788,7 +788,7 @@ class ParseUserCombineTests: XCTestCase { // swiftlint:disable:this type_body_le } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser), @@ -880,7 +880,7 @@ class ParseUserCombineTests: XCTestCase { // swiftlint:disable:this type_body_le } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser), diff --git a/Tests/ParseSwiftTests/ParseUserTests.swift b/Tests/ParseSwiftTests/ParseUserTests.swift index 01b58bdb3..fd45cf78e 100644 --- a/Tests/ParseSwiftTests/ParseUserTests.swift +++ b/Tests/ParseSwiftTests/ParseUserTests.swift @@ -92,7 +92,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll() @@ -264,7 +264,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertEqual(User.current?.customKey, userOnServer.customKey) //Should be updated in Keychain - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser) else { XCTFail("Should get object from Keychain") @@ -333,7 +333,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length //Should be updated in memory XCTAssertEqual(User.current?.updatedAt, fetchedUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser) else { @@ -412,7 +412,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation1, expectation2], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeFetchAsync() { var user = User() let objectId = "yarr" @@ -542,7 +542,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertEqual(command.body?.email, email) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testUpdateCommandCurrentUserModifiedEmail() throws { try userSignUp() guard let user = User.current, @@ -631,7 +631,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertEqual(User.current?.updatedAt, savedUpdatedAt) XCTAssertEqual(User.current?.email, user.email) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser) else { @@ -697,7 +697,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertEqual(User.current?.updatedAt, savedUpdatedAt) XCTAssertEqual(User.current?.email, user.email) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser) else { @@ -767,7 +767,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertEqual(User.current?.updatedAt, savedUpdatedAt) XCTAssertEqual(User.current?.email, user.email) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser) else { @@ -841,7 +841,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertEqual(User.current?.updatedAt, savedUpdatedAt) XCTAssertEqual(User.current?.email, user.email) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser) else { @@ -969,7 +969,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length wait(for: [expectation1, expectation2], timeout: 20.0) } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) func testThreadSafeUpdateAsync() { var user = User() let objectId = "yarr" @@ -1446,7 +1446,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length XCTFail("Should have a new installation") } - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) if let installationFromKeychain: CurrentInstallationContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentInstallation) { if installationFromKeychain.installationId == oldInstallationId @@ -1715,7 +1715,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length let customField = "Changed" User.current?.customKey = customField User.saveCurrentContainerToKeychain() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser) else { XCTFail("Should get object from Keychain") @@ -1861,7 +1861,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser), @@ -1945,7 +1945,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser), @@ -2028,7 +2028,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser), @@ -2075,7 +2075,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser), @@ -2166,7 +2166,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser), @@ -2221,7 +2221,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length } XCTAssertEqual(updatedCurrentDate, serverUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser), @@ -2419,7 +2419,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length XCTAssertEqual(User.current?.updatedAt, becomeUpdatedAt) //Should be updated in Keychain - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser) else { XCTFail("Should get object from Keychain") @@ -2491,7 +2491,7 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length //Should be updated in memory XCTAssertEqual(User.current?.updatedAt, becomeUpdatedAt) - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) //Should be updated in Keychain guard let keychainUser: CurrentUserContainer = try? KeychainStore.shared.get(valueFor: ParseStorage.Keys.currentUser) else { diff --git a/Tests/ParseSwiftTests/ParseVersionTests.swift b/Tests/ParseSwiftTests/ParseVersionTests.swift index 24302f911..2a3dbe8f7 100644 --- a/Tests/ParseSwiftTests/ParseVersionTests.swift +++ b/Tests/ParseSwiftTests/ParseVersionTests.swift @@ -27,7 +27,7 @@ class ParseVersionTests: XCTestCase { override func tearDownWithError() throws { try super.tearDownWithError() MockURLProtocol.removeAll() - #if !os(Linux) && !os(Android) + #if !os(Linux) && !os(Android) && !os(Windows) try KeychainStore.shared.deleteAll() #endif try ParseStorage.shared.deleteAll()