From 880ea1f005acdb161beb533c6007255bfd95d059 Mon Sep 17 00:00:00 2001 From: emrcftci Date: Sun, 17 May 2020 00:36:31 +0300 Subject: [PATCH] fix(*): Revert unwanted commits - Revert accidently created commit from another pull-request -> #1081 --- ObjectMapper.xcodeproj/project.pbxproj | 40 ++++++++++--------- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++ Tests/ObjectMapperTests/ImmutableTests.swift | 4 +- Tests/ObjectMapperTests/MapContextTests.swift | 12 +++--- .../MappableExtensionsTests.swift | 10 ++--- .../ObjectMapperTests/PerformanceTests.swift | 2 +- 6 files changed, 43 insertions(+), 33 deletions(-) create mode 100644 ObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/ObjectMapper.xcodeproj/project.pbxproj b/ObjectMapper.xcodeproj/project.pbxproj index 329a283b..8e6e8c6d 100644 --- a/ObjectMapper.xcodeproj/project.pbxproj +++ b/ObjectMapper.xcodeproj/project.pbxproj @@ -728,11 +728,11 @@ }; 6AAC8F7519F03C2900E7A677 = { CreatedOnToolsVersion = 6.0.1; - LastSwiftMigration = 1120; + LastSwiftMigration = 0900; }; 6AAC8F8019F03C2900E7A677 = { CreatedOnToolsVersion = 6.0.1; - LastSwiftMigration = 1120; + LastSwiftMigration = 0900; }; CD1602FE1AC023D5000CD69A = { CreatedOnToolsVersion = 6.2; @@ -1108,7 +1108,7 @@ PRODUCT_NAME = "$(PROJECT_NAME)"; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -1137,7 +1137,7 @@ PRODUCT_NAME = "$(PROJECT_NAME)"; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -1156,7 +1156,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.ObjectMapper-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; @@ -1174,7 +1174,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.ObjectMapper-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; @@ -1200,7 +1200,7 @@ PRODUCT_NAME = "$(PROJECT_NAME)"; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 4; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -1228,7 +1228,7 @@ PRODUCT_NAME = "$(PROJECT_NAME)"; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 4; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -1363,7 +1363,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -1384,7 +1385,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.tristanhimmelman.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -1402,7 +1404,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.heart.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1414,7 +1417,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.heart.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -1442,7 +1446,7 @@ PRODUCT_NAME = "$(PROJECT_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -1470,7 +1474,7 @@ PRODUCT_NAME = "$(PROJECT_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -1491,7 +1495,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.heart.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -1508,7 +1512,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.heart.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -1532,7 +1536,7 @@ PRODUCT_NAME = ObjectMapper; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -1557,7 +1561,7 @@ PRODUCT_NAME = ObjectMapper; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/ObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/ObjectMapper.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Tests/ObjectMapperTests/ImmutableTests.swift b/Tests/ObjectMapperTests/ImmutableTests.swift index f722add1..bafba916 100644 --- a/Tests/ObjectMapperTests/ImmutableTests.swift +++ b/Tests/ObjectMapperTests/ImmutableTests.swift @@ -201,12 +201,12 @@ class ImmutableObjectTests: XCTestCase { XCTAssertEqual(immutable.delimiterNestedDictionary, ["a": 10, "b": 20, "c": 30]) let JSON2: [String: Any] = [ "prop1": "prop1", "prop2": NSNull() ] - let immutable2 = try? mapper.map(JSON: JSON2) as Struct + let immutable2 = try? mapper.map(JSON: JSON2) XCTAssertNil(immutable2) // TODO: ImmutableMappable to JSON let JSONFromObject = mapper.toJSON(immutable) - let objectFromJSON = try? mapper.map(JSON: JSONFromObject) as Struct + let objectFromJSON = try? mapper.map(JSON: JSONFromObject) XCTAssertNotNil(objectFromJSON) assertImmutableObjectsEqual(objectFromJSON!, immutable) } diff --git a/Tests/ObjectMapperTests/MapContextTests.swift b/Tests/ObjectMapperTests/MapContextTests.swift index 0d7bb3a8..13a4b34f 100644 --- a/Tests/ObjectMapperTests/MapContextTests.swift +++ b/Tests/ObjectMapperTests/MapContextTests.swift @@ -138,7 +138,7 @@ class MapContextTests: XCTestCase { let JSON = ["name": "Anton"] let context = ImmutableContext(isDeveloper: true) - let person = try? Mapper(context: context).map(JSON: JSON) as ImmutablePerson + let person = try? Mapper(context: context).map(JSON: JSON) XCTAssertNotNil(person) @@ -149,7 +149,7 @@ class MapContextTests: XCTestCase { let JSON = ["name": "Anton"] let context = ImmutableContext(isDeveloper: true) - let person = try? ImmutablePerson(JSON: JSON, context: context) as ImmutablePerson + let person = try? ImmutablePerson(JSON: JSON, context: context) XCTAssertNotNil(person) XCTAssertEqual(person?.isDeveloper ?? !context.isDeveloper, context.isDeveloper) @@ -172,7 +172,7 @@ class MapContextTests: XCTestCase { let JSON = ["person": ["name": "Anton"]] let context = ImmutableContext(isDeveloper: true) - let nestedPerson = try? Mapper(context: context).map(JSON: JSON) as ImmutableNestedPerson + let nestedPerson = try? Mapper(context: context).map(JSON: JSON) XCTAssertNotNil(nestedPerson) XCTAssertEqual(nestedPerson?.person.isDeveloper ?? !context.isDeveloper, context.isDeveloper) @@ -182,7 +182,7 @@ class MapContextTests: XCTestCase { let JSON = ["person": ["name": "Anton"]] let context = ImmutableContext(isDeveloper: true) - let nestedPerson = try? ImmutableNestedPerson(JSON: JSON, context: context) as ImmutableNestedPerson + let nestedPerson = try? ImmutableNestedPerson(JSON: JSON, context: context) XCTAssertNotNil(nestedPerson) XCTAssertEqual(nestedPerson?.person.isDeveloper ?? !context.isDeveloper, context.isDeveloper) @@ -207,7 +207,7 @@ class MapContextTests: XCTestCase { let JSON = ["persons": [["name": "Tristan"], ["name": "Anton"]]] let context = ImmutableContext(isDeveloper: true) - let personList = try? Mapper(context: context).map(JSON: JSON) as ImmutablePersonList + let personList = try? Mapper(context: context).map(JSON: JSON) XCTAssertNotNil(personList) @@ -220,7 +220,7 @@ class MapContextTests: XCTestCase { let JSON = ["persons": [["name": "Tristan"], ["name": "Anton"]]] let context = ImmutableContext(isDeveloper: true) - let personList = try? ImmutablePersonList(JSON: JSON, context: context) as ImmutablePersonList + let personList = try? ImmutablePersonList(JSON: JSON, context: context) XCTAssertNotNil(personList) diff --git a/Tests/ObjectMapperTests/MappableExtensionsTests.swift b/Tests/ObjectMapperTests/MappableExtensionsTests.swift index d3ee7960..b885cf1f 100644 --- a/Tests/ObjectMapperTests/MappableExtensionsTests.swift +++ b/Tests/ObjectMapperTests/MappableExtensionsTests.swift @@ -44,14 +44,12 @@ struct TestMappable: Mappable, Equatable, Hashable { mutating func mapping(map: Map) { value <- map["value"] } - - - func hash(into hasher: inout Hasher) { + + var hashValue: Int { if let value = value { - hasher.combine(value) - } else { - hasher.combine(NSIntegerMax) + return value.hashValue } + return NSIntegerMax } } diff --git a/Tests/ObjectMapperTests/PerformanceTests.swift b/Tests/ObjectMapperTests/PerformanceTests.swift index fa2819be..6e0620ba 100644 --- a/Tests/ObjectMapperTests/PerformanceTests.swift +++ b/Tests/ObjectMapperTests/PerformanceTests.swift @@ -71,7 +71,7 @@ class PerformanceTests: XCTestCase { func testPerformanceImmutable() { self.measure { - _ = try? Mapper().mapArray(JSONString: self.JSONTestString) as [PerformanceImmutableMappableObject] + _ = try? Mapper().mapArray(JSONString: self.JSONTestString) } } }