Skip to content

Commit 8b974af

Browse files
committed
Remove some more unnecessary conditional imports
1 parent 289f9fd commit 8b974af

7 files changed

+10
-12
lines changed

Tests/GRDBTests/DatabaseAggregateTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,11 @@ class DatabaseAggregateTests: GRDBTestCase {
382382
XCTFail("Expected DatabaseError")
383383
} catch let error as DatabaseError {
384384
XCTAssertEqual(error.resultCode, .SQLITE_ERROR)
385+
#if canImport(ObjectiveC) // non-Darwin platforms bridge NSError differently and do not set the message the same
385386
XCTAssertTrue(error.message!.contains("CustomErrorDomain"))
386387
XCTAssertTrue(error.message!.contains("123"))
387388
XCTAssertTrue(error.message!.contains("custom error message"))
389+
#endif
388390
}
389391
}
390392
}
@@ -470,9 +472,11 @@ class DatabaseAggregateTests: GRDBTestCase {
470472
XCTFail("Expected DatabaseError")
471473
} catch let error as DatabaseError {
472474
XCTAssertEqual(error.resultCode, .SQLITE_ERROR)
475+
#if canImport(ObjectiveC) // non-Darwin platforms bridge NSError differently and do not set the message the same
473476
XCTAssertTrue(error.message!.contains("CustomErrorDomain"))
474477
XCTAssertTrue(error.message!.contains("123"))
475478
XCTAssertTrue(error.message!.contains("custom error message"))
479+
#endif
476480
}
477481
}
478482
}

Tests/GRDBTests/DatabaseErrorTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ class DatabaseErrorTests: GRDBTestCase {
216216
}
217217

218218
func testNSErrorBridging() throws {
219+
#if !canImport(ObjectiveC)
220+
throw XCTSkip("NSError bridging works differently on non-Darwin platforms")
221+
#else
219222
let dbQueue = try makeDatabaseQueue()
220223
try dbQueue.inDatabase { db in
221224
try db.create(table: "parents") { $0.column("id", .integer).primaryKey() }
@@ -229,5 +232,6 @@ class DatabaseErrorTests: GRDBTestCase {
229232
XCTAssertNotNil(error.localizedFailureReason)
230233
}
231234
}
235+
#endif
232236
}
233237
}

Tests/GRDBTests/DatabaseFunctionTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,11 @@ class DatabaseFunctionTests: GRDBTestCase {
336336
XCTFail("Expected DatabaseError")
337337
} catch let error as DatabaseError {
338338
XCTAssertEqual(error.resultCode, .SQLITE_ERROR)
339+
#if canImport(ObjectiveC) // non-Darwin platforms bridge NSError differently and do not set the message the same
339340
XCTAssertTrue(error.message!.contains("CustomErrorDomain"))
340341
XCTAssertTrue(error.message!.contains("123"))
341342
XCTAssertTrue(error.message!.contains("custom error message"))
343+
#endif
342344
}
343345
}
344346
}

Tests/GRDBTests/QueryInterfaceExpressionsTests.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import XCTest
22
@testable import GRDB
3-
#if GRDBCIPHER
4-
import SQLCipher
5-
#endif
63

74
private struct Col {
85
static let id = Column("id")

Tests/GRDBTests/SingletonRecordTest.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import XCTest
22
import GRDB
3-
#if GRDBCIPHER
4-
import SQLCipher
5-
#endif
63

74
private struct AppConfiguration: Codable {
85
// Support for the single row guarantee

Tests/GRDBTests/TableRecordDeleteTests.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import XCTest
22
import GRDB
3-
#if GRDBCIPHER
4-
import SQLCipher
5-
#endif
63

74
private struct Hacker : TableRecord {
85
static let databaseTableName = "hackers"

Tests/GRDBTests/TableRecordUpdateTests.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import XCTest
22
import GRDB
3-
#if GRDBCIPHER
4-
import SQLCipher
5-
#endif
63

74
private struct Player: Codable, PersistableRecord, FetchableRecord, Hashable {
85
var id: Int64

0 commit comments

Comments
 (0)