From 5513eab099a3ec2587fa3f543de72a899e9ecc15 Mon Sep 17 00:00:00 2001 From: Tim De Jong Date: Sun, 12 Oct 2025 17:13:46 +0200 Subject: [PATCH] Fixed the tests in DatabaseQueueTests.swift --- Tests/GRDBTests/DatabaseQueueTests.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tests/GRDBTests/DatabaseQueueTests.swift b/Tests/GRDBTests/DatabaseQueueTests.swift index c22be8326..0372d9777 100644 --- a/Tests/GRDBTests/DatabaseQueueTests.swift +++ b/Tests/GRDBTests/DatabaseQueueTests.swift @@ -129,10 +129,12 @@ class DatabaseQueueTests: GRDBTestCase { XCTAssertEqual(db.configuration.label, nil) XCTAssertEqual(db.description, "GRDB.DatabaseQueue") +#if canImport(Darwin) // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. let label = String(utf8String: __dispatch_queue_get_label(nil)) XCTAssertEqual(label, "GRDB.DatabaseQueue") +#endif } } @@ -144,10 +146,12 @@ class DatabaseQueueTests: GRDBTestCase { XCTAssertEqual(db.configuration.label, "Toreador") XCTAssertEqual(db.description, "Toreador") +#if canImport(Darwin) // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. let label = String(utf8String: __dispatch_queue_get_label(nil)) XCTAssertEqual(label, "Toreador") +#endif } } @@ -221,6 +225,9 @@ class DatabaseQueueTests: GRDBTestCase { } func testQoS() throws { +#if !canImport(Darwin) + throw XCTSkip("__dispatch_get_global_queue not available on non-Darwin platforms") +#else func test(qos: DispatchQoS) throws { // https://forums.swift.org/t/what-is-the-default-target-queue-for-a-serial-queue/18094/5 // @@ -256,6 +263,7 @@ class DatabaseQueueTests: GRDBTestCase { try test(qos: .background) try test(qos: .userInitiated) +#endif } // MARK: - SQLITE_BUSY prevention