diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-03-06 01:29:19 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-03-07 17:31:01 -0800 |
commit | 91de48356ebcefbd0ac61e4da3f7e7c38706c4f8 (patch) | |
tree | 4ac7c9d9559182491d9ed343d5c368ebddbc2312 /platform/darwin | |
parent | 9f708d80f4c1a776e590f9feafc9c65a93418fbd (diff) | |
download | qtlocation-mapboxgl-91de48356ebcefbd0ac61e4da3f7e7c38706c4f8.tar.gz |
[macos] Upgraded tests to Swift 4
Diffstat (limited to 'platform/darwin')
-rw-r--r-- | platform/darwin/test/MGLSDKTestHelpers.swift | 17 |
1 files changed, 11 insertions, 6 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 |