Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 91de483

Browse files
committed
[macos] Upgraded tests to Swift 4
1 parent 9f708d8 commit 91de483

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

platform/darwin/test/MGLSDKTestHelpers.swift

+11-6
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ extension MGLSDKTestHelpers {
2323
class func protocolMethodDescriptions(_ p: Protocol) -> Set<String> {
2424
var methods = Set<String>()
2525
var methodCount = UInt32()
26-
let methodDescriptionList: UnsafeMutablePointer<objc_method_description>! = protocol_copyMethodDescriptionList(p, false, true, &methodCount)
26+
let methodDescriptionList = protocol_copyMethodDescriptionList(p, false, true, &methodCount)
2727
for i in 0..<Int(methodCount) {
28-
let description: objc_method_description = methodDescriptionList[i]
28+
let description = methodDescriptionList![i]
2929
XCTAssertNotNil(description.name?.description)
3030
methods.insert(description.name!.description)
3131
}
@@ -36,11 +36,16 @@ extension MGLSDKTestHelpers {
3636
class func classMethodDescriptions(_ cls: Swift.AnyClass) -> Set<String> {
3737
var methods = Set<String>()
3838
var methodCount = UInt32()
39-
let methodList: UnsafeMutablePointer<Method?>! = class_copyMethodList(cls, &methodCount)
39+
let methodList = class_copyMethodList(cls, &methodCount)
4040
for i in 0..<Int(methodCount) {
41-
let method = methodList[i]
42-
let selector : Selector = method_getName(method)
43-
methods.insert(selector.description)
41+
let method = methodList![i]
42+
let selector = method_getName(method)
43+
#if os(macOS)
44+
methods.insert(selector.description)
45+
#else
46+
XCTAssertNotNil(selector)
47+
methods.insert(selector!.description)
48+
#endif
4449
}
4550
free(methodList)
4651
return methods

platform/macos/macos.xcodeproj/project.pbxproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@
13781378
TargetAttributes = {
13791379
DA839E911CC2E3400062CAFB = {
13801380
CreatedOnToolsVersion = 7.3;
1381-
LastSwiftMigration = 0830;
1381+
LastSwiftMigration = 0920;
13821382
};
13831383
DAAA17961CE13BAE00731EFE = {
13841384
CreatedOnToolsVersion = 7.3.1;
@@ -1388,7 +1388,7 @@
13881388
};
13891389
DAE6C3301CC30DB200DB3429 = {
13901390
CreatedOnToolsVersion = 7.3;
1391-
LastSwiftMigration = 0800;
1391+
LastSwiftMigration = 0920;
13921392
};
13931393
};
13941394
};
@@ -1885,7 +1885,7 @@
18851885
PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL;
18861886
PRODUCT_NAME = "Mapbox GL";
18871887
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1888-
SWIFT_VERSION = 3.0;
1888+
SWIFT_VERSION = 4.0;
18891889
};
18901890
name = Debug;
18911891
};
@@ -1900,7 +1900,7 @@
19001900
OTHER_CFLAGS = "-fvisibility=hidden";
19011901
PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL;
19021902
PRODUCT_NAME = "Mapbox GL";
1903-
SWIFT_VERSION = 3.0;
1903+
SWIFT_VERSION = 4.0;
19041904
};
19051905
name = Release;
19061906
};
@@ -2026,7 +2026,7 @@
20262026
PRODUCT_NAME = "$(TARGET_NAME)";
20272027
SWIFT_OBJC_BRIDGING_HEADER = "../darwin/test/test-Bridging-Header.h";
20282028
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
2029-
SWIFT_VERSION = 3.0;
2029+
SWIFT_VERSION = 4.0;
20302030
};
20312031
name = Debug;
20322032
};
@@ -2053,7 +2053,7 @@
20532053
PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.test;
20542054
PRODUCT_NAME = "$(TARGET_NAME)";
20552055
SWIFT_OBJC_BRIDGING_HEADER = "../darwin/test/test-Bridging-Header.h";
2056-
SWIFT_VERSION = 3.0;
2056+
SWIFT_VERSION = 4.0;
20572057
};
20582058
name = Release;
20592059
};

0 commit comments

Comments
 (0)