Skip to content

Commit

Permalink
bump target to iOS 13.
Browse files Browse the repository at this point in the history
  • Loading branch information
hfutrell committed Oct 18, 2024
1 parent 8e9bcbb commit 406c3bc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions BezierKit/BezierKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -930,7 +930,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
Expand Down
25 changes: 12 additions & 13 deletions BezierKit/BezierKitTests/LockTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#if !os(WASI)
class LockTests: XCTestCase {
@MainActor func testPathPropertyAtomicity() {
func testPathPropertyAtomicity() async {

@MainActor class Results: Sendable {
#if canImport(CoreGraphics)
Expand All @@ -28,15 +28,15 @@ class LockTests: XCTestCase {
let expectation = XCTestExpectation()
expectation.expectedFulfillmentCount = threadCount

let results = Results()
let results = await Results()
for i in 0..<threadCount {
let index = i
DispatchQueue.global(qos: .default).async {
Task.detached {
#if canImport(CoreGraphics)
let pathValue = path.cgPath
#endif
let boundingBoxValue = path.boundingBox
DispatchQueue.main.async {
await MainActor.run {
#if canImport(CoreGraphics)
results.cgPaths[index] = pathValue
#endif
Expand All @@ -45,19 +45,18 @@ class LockTests: XCTestCase {
}
}
}
wait(for: [expectation], timeout: 10.0)

DispatchQueue.main.async {
await fulfillment(of: [expectation], timeout: 10.0)

await MainActor.run {
#if canImport(CoreGraphics)
let cgPaths = results.cgPaths
XCTAssertEqual(cgPaths.values.count, threadCount)
XCTAssertEqual(cgPaths[0], Path(rect: rect).cgPath)
XCTAssertTrue(cgPaths.values.allSatisfy { $0 === cgPaths[0] }, "cgPaths should all refer to the same instance (was it initialized more than once?)")
XCTAssertEqual(results.cgPaths.values.count, threadCount)
XCTAssertEqual(results.cgPaths[0], Path(rect: rect).cgPath)
XCTAssertTrue(results.cgPaths.values.allSatisfy { $0 === results.cgPaths[0] }, "cgPaths should all refer to the same instance (was it initialized more than once?)")
#endif
let boundingBoxes = results.boundingBoxes
let expectedBoundingBox = Path(rect: rect).boundingBox
XCTAssertEqual(boundingBoxes.values.count, threadCount)
XCTAssertTrue(boundingBoxes.values.allSatisfy { $0 == expectedBoundingBox })
XCTAssertEqual(results.boundingBoxes.values.count, threadCount)
XCTAssertTrue(results.boundingBoxes.values.allSatisfy { $0 == expectedBoundingBox })
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PackageDescription
let package = Package(
name: "BezierKit",
platforms: [
.macOS(.v10_12), .iOS(.v12),
.macOS(.v10_12), .iOS(.v13),
],
products: [
.library(
Expand Down

0 comments on commit 406c3bc

Please sign in to comment.