Skip to content

Commit 5ba4b88

Browse files
committed
🚨 Fix compiler errors on remaining targets
1 parent a383f71 commit 5ba4b88

File tree

4 files changed

+102
-65
lines changed

4 files changed

+102
-65
lines changed

‎.swiftpm/xcode/xcshareddata/xcschemes/swift-geo-Package.xcscheme

Lines changed: 70 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
buildForAnalyzing = "YES">
4343
<BuildableReference
4444
BuildableIdentifier = "primary"
45-
BlueprintIdentifier = "GeodeticDisplay"
46-
BuildableName = "GeodeticDisplay"
47-
BlueprintName = "GeodeticDisplay"
45+
BlueprintIdentifier = "Geodesy"
46+
BuildableName = "Geodesy"
47+
BlueprintName = "Geodesy"
4848
ReferencedContainer = "container:">
4949
</BuildableReference>
5050
</BuildActionEntry>
@@ -56,9 +56,9 @@
5656
buildForAnalyzing = "YES">
5757
<BuildableReference
5858
BuildableIdentifier = "primary"
59-
BlueprintIdentifier = "Geodesy"
60-
BuildableName = "Geodesy"
61-
BlueprintName = "Geodesy"
59+
BlueprintIdentifier = "GeodeticDisplay"
60+
BuildableName = "GeodeticDisplay"
61+
BlueprintName = "GeodeticDisplay"
6262
ReferencedContainer = "container:">
6363
</BuildableReference>
6464
</BuildActionEntry>
@@ -84,23 +84,9 @@
8484
buildForAnalyzing = "YES">
8585
<BuildableReference
8686
BuildableIdentifier = "primary"
87-
BlueprintIdentifier = "Turf"
88-
BuildableName = "Turf"
89-
BlueprintName = "Turf"
90-
ReferencedContainer = "container:">
91-
</BuildableReference>
92-
</BuildActionEntry>
93-
<BuildActionEntry
94-
buildForTesting = "YES"
95-
buildForRunning = "NO"
96-
buildForProfiling = "NO"
97-
buildForArchiving = "NO"
98-
buildForAnalyzing = "NO">
99-
<BuildableReference
100-
BuildableIdentifier = "primary"
101-
BlueprintIdentifier = "TurfTests"
102-
BuildableName = "TurfTests"
103-
BlueprintName = "TurfTests"
87+
BlueprintIdentifier = "GeodeticConversions"
88+
BuildableName = "GeodeticConversions"
89+
BlueprintName = "GeodeticConversions"
10490
ReferencedContainer = "container:">
10591
</BuildableReference>
10692
</BuildActionEntry>
@@ -112,9 +98,9 @@
11298
buildForAnalyzing = "YES">
11399
<BuildableReference
114100
BuildableIdentifier = "primary"
115-
BlueprintIdentifier = "WGS84"
116-
BuildableName = "WGS84"
117-
BlueprintName = "WGS84"
101+
BlueprintIdentifier = "Turf"
102+
BuildableName = "Turf"
103+
BlueprintName = "Turf"
118104
ReferencedContainer = "container:">
119105
</BuildableReference>
120106
</BuildActionEntry>
@@ -126,9 +112,9 @@
126112
buildForAnalyzing = "YES">
127113
<BuildableReference
128114
BuildableIdentifier = "primary"
129-
BlueprintIdentifier = "TurfMapKit"
130-
BuildableName = "TurfMapKit"
131-
BlueprintName = "TurfMapKit"
115+
BlueprintIdentifier = "TurfCore"
116+
BuildableName = "TurfCore"
117+
BlueprintName = "TurfCore"
132118
ReferencedContainer = "container:">
133119
</BuildableReference>
134120
</BuildActionEntry>
@@ -140,9 +126,9 @@
140126
buildForAnalyzing = "YES">
141127
<BuildableReference
142128
BuildableIdentifier = "primary"
143-
BlueprintIdentifier = "WGS84Core"
144-
BuildableName = "WGS84Core"
145-
BlueprintName = "WGS84Core"
129+
BlueprintIdentifier = "TurfMapKit"
130+
BuildableName = "TurfMapKit"
131+
BlueprintName = "TurfMapKit"
146132
ReferencedContainer = "container:">
147133
</BuildableReference>
148134
</BuildActionEntry>
@@ -154,9 +140,9 @@
154140
buildForAnalyzing = "YES">
155141
<BuildableReference
156142
BuildableIdentifier = "primary"
157-
BlueprintIdentifier = "WGS84Geometry"
158-
BuildableName = "WGS84Geometry"
159-
BlueprintName = "WGS84Geometry"
143+
BlueprintIdentifier = "WGS84"
144+
BuildableName = "WGS84"
145+
BlueprintName = "WGS84"
160146
ReferencedContainer = "container:">
161147
</BuildableReference>
162148
</BuildActionEntry>
@@ -168,9 +154,9 @@
168154
buildForAnalyzing = "YES">
169155
<BuildableReference
170156
BuildableIdentifier = "primary"
171-
BlueprintIdentifier = "WGS84Turf"
172-
BuildableName = "WGS84Turf"
173-
BlueprintName = "WGS84Turf"
157+
BlueprintIdentifier = "WGS84Core"
158+
BuildableName = "WGS84Core"
159+
BlueprintName = "WGS84Core"
174160
ReferencedContainer = "container:">
175161
</BuildableReference>
176162
</BuildActionEntry>
@@ -182,9 +168,9 @@
182168
buildForAnalyzing = "YES">
183169
<BuildableReference
184170
BuildableIdentifier = "primary"
185-
BlueprintIdentifier = "TurfCore"
186-
BuildableName = "TurfCore"
187-
BlueprintName = "TurfCore"
171+
BlueprintIdentifier = "WGS84Geometry"
172+
BuildableName = "WGS84Geometry"
173+
BlueprintName = "WGS84Geometry"
188174
ReferencedContainer = "container:">
189175
</BuildableReference>
190176
</BuildActionEntry>
@@ -196,9 +182,9 @@
196182
buildForAnalyzing = "YES">
197183
<BuildableReference
198184
BuildableIdentifier = "primary"
199-
BlueprintIdentifier = "GeodeticConversions"
200-
BuildableName = "GeodeticConversions"
201-
BlueprintName = "GeodeticConversions"
185+
BlueprintIdentifier = "WGS84Turf"
186+
BuildableName = "WGS84Turf"
187+
BlueprintName = "WGS84Turf"
202188
ReferencedContainer = "container:">
203189
</BuildableReference>
204190
</BuildActionEntry>
@@ -223,18 +209,47 @@
223209
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
224210
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
225211
shouldUseLaunchSchemeArgsEnv = "YES"
226-
enableAddressSanitizer = "YES">
212+
enableAddressSanitizer = "YES"
213+
codeCoverageEnabled = "YES"
214+
onlyGenerateCoverageForSpecifiedTargets = "YES">
215+
<CodeCoverageTargets>
216+
<BuildableReference
217+
BuildableIdentifier = "primary"
218+
BlueprintIdentifier = "Geodesy"
219+
BuildableName = "Geodesy"
220+
BlueprintName = "Geodesy"
221+
ReferencedContainer = "container:">
222+
</BuildableReference>
223+
<BuildableReference
224+
BuildableIdentifier = "primary"
225+
BlueprintIdentifier = "GeodeticConversions"
226+
BuildableName = "GeodeticConversions"
227+
BlueprintName = "GeodeticConversions"
228+
ReferencedContainer = "container:">
229+
</BuildableReference>
230+
<BuildableReference
231+
BuildableIdentifier = "primary"
232+
BlueprintIdentifier = "GeodeticGeometry"
233+
BuildableName = "GeodeticGeometry"
234+
BlueprintName = "GeodeticGeometry"
235+
ReferencedContainer = "container:">
236+
</BuildableReference>
237+
<BuildableReference
238+
BuildableIdentifier = "primary"
239+
BlueprintIdentifier = "Turf"
240+
BuildableName = "Turf"
241+
BlueprintName = "Turf"
242+
ReferencedContainer = "container:">
243+
</BuildableReference>
244+
<BuildableReference
245+
BuildableIdentifier = "primary"
246+
BlueprintIdentifier = "WGS84"
247+
BuildableName = "WGS84"
248+
BlueprintName = "WGS84"
249+
ReferencedContainer = "container:">
250+
</BuildableReference>
251+
</CodeCoverageTargets>
227252
<Testables>
228-
<TestableReference
229-
skipped = "NO">
230-
<BuildableReference
231-
BuildableIdentifier = "primary"
232-
BlueprintIdentifier = "TurfTests"
233-
BuildableName = "TurfTests"
234-
BlueprintName = "TurfTests"
235-
ReferencedContainer = "container:">
236-
</BuildableReference>
237-
</TestableReference>
238253
<TestableReference
239254
skipped = "NO">
240255
<BuildableReference

‎Sources/GeodeticConversions/ConvertibleCRS.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public extension Point {
4242
static func + <OtherCRS>(lhs: Self, rhs: Point<OtherCRS>) -> Self
4343
where CRS: ConvertibleCRS, OtherCRS: ConvertibleCRS
4444
{
45-
Self.init(coordinates: lhs.coordinates + rhs.coordinates.to(to: OtherCRS.self))
45+
Self.init(coordinates: lhs.coordinates + rhs.coordinates.to(CRS.self))
4646
}
4747
}
4848

‎Tests/TurfCoreTests/Toolbox/MapSnapshot.swift

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,19 @@ func snapshot(
4545
assert(points.count == polyline.pointCount)
4646
mapView.addOverlay(polyline, level: .aboveRoads)
4747

48-
while (!delegate.renderingFinished) {
48+
while (delegate.renderingStep == .rendering) {
4949
// Wait 100ms
5050
try await Task.sleep(nanoseconds: 100 * NSEC_PER_MSEC)
5151
}
52-
return mapView.snapshot
52+
switch delegate.renderingStep {
53+
case .rendered:
54+
return mapView.snapshot
55+
case .error(let error):
56+
throw XCTSkip(String(describing: error))
57+
case .rendering:
58+
XCTFail("Unexpected code path: `delegate.renderingStep` should not equal `.rendering`", file: file, line: line)
59+
throw XCTSkip()
60+
}
5361
}
5462

5563
extension NSView {
@@ -65,7 +73,11 @@ extension NSView {
6573

6674
final class MapDelegate: NSObject, MKMapViewDelegate {
6775

68-
var renderingFinished = false
76+
enum RenderingStep: Equatable {
77+
case rendering, rendered, error(MKError)
78+
}
79+
80+
var renderingStep = RenderingStep.rendering
6981

7082
func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer {
7183
if overlay is MKPolyline {
@@ -77,8 +89,17 @@ final class MapDelegate: NSObject, MKMapViewDelegate {
7789
return MKOverlayRenderer()
7890
}
7991

92+
func mapViewDidFailLoadingMap(_ mapView: MKMapView, withError error: Error) {
93+
if let error = error as? MKError {
94+
self.renderingStep = .error(error)
95+
} else {
96+
assertionFailure("Error is not a `MKError`: \(error)")
97+
self.renderingStep = .error(.init(.unknown, userInfo: [:]))
98+
}
99+
}
100+
80101
func mapViewDidFinishRenderingMap(_ mapView: MKMapView, fullyRendered: Bool) {
81-
self.renderingFinished = true
102+
self.renderingStep = .rendered
82103
}
83104

84105
}

‎Tests/WGS84Tests/WSG84Tests.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,25 @@
77
//
88

99
import Geodesy
10+
import GeodeticConversions
1011
import WGS84
1112
import XCTest
1213

1314
final class ConversionTests: XCTestCase {
1415
/// Example from <https://epsg.io/transform#s_srs=4979&t_srs=4978&x=90&y=0>.
1516
func testEPSG9602() {
1617
let c1 = Coordinate2D(x: 0, y: 90)
17-
let c2 = c1.transformed(toCRS: WGS84Geographic3DCRS.self)
18+
let c2 = c1.to(WGS84Geographic3DCRS.self)
1819
XCTAssertEqual(c2, Coordinate3D(x: 0, y: 90, z: 0))
19-
let c3 = c2.transformed(toCRS: WGS84GeocentricCRS.self)
20-
XCTAssertEqual(c3, Coordinate3DOf<WGS84GeocentricCRS>(
20+
let c3 = c2.to(WGS84GeocentricCRS.self)
21+
XCTAssertEqual(c3, Coordinates3DOf<WGS84GeocentricCRS>(
2122
x: 3.905482530786651e-10,
2223
y: .init(WGS84Ensemble.Ellipsoid.semiMajorAxis),
2324
z: 0
2425
))
25-
let c4 = c3.transformed(toCRS: WGS84Geographic3DCRS.self)
26+
let c4 = c3.to(WGS84Geographic3DCRS.self)
2627
XCTAssertEqual(c4, Coordinate3D(x: 0, y: 90, z: 0))
27-
let c5 = c4.transformed(toCRS: WGS84Geographic2DCRS.self)
28+
let c5 = c4.to(WGS84Geographic2DCRS.self)
2829
XCTAssertEqual(c5, c1)
2930
}
3031

0 commit comments

Comments
 (0)