diff options
-rw-r--r-- | platform/darwin/test/MGLSDKTestHelpers.swift | 17 | ||||
-rw-r--r-- | platform/macos/macos.xcodeproj/project.pbxproj | 12 |
2 files changed, 17 insertions, 12 deletions
diff --git a/platform/darwin/test/MGLSDKTestHelpers.swift b/platform/darwin/test/MGLSDKTestHelpers.swift index 576e3da86b..727d8bf0c6 100644 --- a/platform/darwin/test/MGLSDKTestHelpers.swift +++ b/platform/darwin/test/MGLSDKTestHelpers.swift @@ -23,9 +23,9 @@ extension MGLSDKTestHelpers { class func protocolMethodDescriptions(_ p: Protocol) -> Set<String> { var methods = Set<String>() var methodCount = UInt32() - let methodDescriptionList: UnsafeMutablePointer<objc_method_description>! = protocol_copyMethodDescriptionList(p, false, true, &methodCount) + let methodDescriptionList = protocol_copyMethodDescriptionList(p, false, true, &methodCount) for i in 0..<Int(methodCount) { - let description: objc_method_description = methodDescriptionList[i] + let description = methodDescriptionList![i] XCTAssertNotNil(description.name?.description) methods.insert(description.name!.description) } @@ -36,11 +36,16 @@ extension MGLSDKTestHelpers { class func classMethodDescriptions(_ cls: Swift.AnyClass) -> Set<String> { var methods = Set<String>() var methodCount = UInt32() - let methodList: UnsafeMutablePointer<Method?>! = class_copyMethodList(cls, &methodCount) + let methodList = class_copyMethodList(cls, &methodCount) for i in 0..<Int(methodCount) { - let method = methodList[i] - let selector : Selector = method_getName(method) - methods.insert(selector.description) + let method = methodList![i] + let selector = method_getName(method) + #if os(macOS) + methods.insert(selector.description) + #else + XCTAssertNotNil(selector) + methods.insert(selector!.description) + #endif } free(methodList) return methods diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index 5af3d17b50..2ae0ea3bc0 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -1378,7 +1378,7 @@ TargetAttributes = { DA839E911CC2E3400062CAFB = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0830; + LastSwiftMigration = 0920; }; DAAA17961CE13BAE00731EFE = { CreatedOnToolsVersion = 7.3.1; @@ -1388,7 +1388,7 @@ }; DAE6C3301CC30DB200DB3429 = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0800; + LastSwiftMigration = 0920; }; }; }; @@ -1885,7 +1885,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL; PRODUCT_NAME = "Mapbox GL"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1900,7 +1900,7 @@ OTHER_CFLAGS = "-fvisibility=hidden"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL; PRODUCT_NAME = "Mapbox GL"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -2026,7 +2026,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "../darwin/test/test-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -2053,7 +2053,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.test; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "../darwin/test/test-Bridging-Header.h"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; |