diff --git a/Tests/GRDBTests/DatabasePoolConcurrencyTests.swift b/Tests/GRDBTests/DatabasePoolConcurrencyTests.swift index 0520ed5ff..73e31caab 100644 --- a/Tests/GRDBTests/DatabasePoolConcurrencyTests.swift +++ b/Tests/GRDBTests/DatabasePoolConcurrencyTests.swift @@ -872,6 +872,7 @@ class DatabasePoolConcurrencyTests: GRDBTestCase { let dbPool = try makeDatabasePool() dbPool.writeWithoutTransaction { db in XCTAssertEqual(db.configuration.label, nil) + XCTAssertEqual(db.description, "GRDB.DatabasePool.writer") // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. @@ -884,6 +885,7 @@ class DatabasePoolConcurrencyTests: GRDBTestCase { let block1 = { () in try! dbPool.read { db in XCTAssertEqual(db.configuration.label, nil) + XCTAssertEqual(db.description, "GRDB.DatabasePool.reader.1") // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. @@ -899,6 +901,7 @@ class DatabasePoolConcurrencyTests: GRDBTestCase { try! dbPool.read { db in _ = s2.signal() XCTAssertEqual(db.configuration.label, nil) + XCTAssertEqual(db.description, "GRDB.DatabasePool.reader.2") // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. @@ -917,6 +920,7 @@ class DatabasePoolConcurrencyTests: GRDBTestCase { let dbPool = try makeDatabasePool() dbPool.writeWithoutTransaction { db in XCTAssertEqual(db.configuration.label, "Toreador") + XCTAssertEqual(db.description, "Toreador.writer") // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. @@ -929,6 +933,7 @@ class DatabasePoolConcurrencyTests: GRDBTestCase { let block1 = { () in try! dbPool.read { db in XCTAssertEqual(db.configuration.label, "Toreador") + XCTAssertEqual(db.description, "Toreador.reader.1") // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. @@ -944,6 +949,7 @@ class DatabasePoolConcurrencyTests: GRDBTestCase { try! dbPool.read { db in _ = s2.signal() XCTAssertEqual(db.configuration.label, "Toreador") + XCTAssertEqual(db.description, "Toreador.reader.2") // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. @@ -1319,7 +1325,7 @@ class DatabasePoolConcurrencyTests: GRDBTestCase { } return dbPool! } - + // Test for sample code in Documentation/SharingADatabase.md. // This test passes if this method compiles private func openDatabase(at databaseURL: URL) throws -> DatabasePool { @@ -1348,7 +1354,7 @@ class DatabasePoolConcurrencyTests: GRDBTestCase { } return dbPool } - + // Test for sample code in Documentation/SharingADatabase.md. // This test passes if this method compiles private func openReadOnlyDatabase(at databaseURL: URL) throws -> DatabasePool? { diff --git a/Tests/GRDBTests/DatabaseQueueTests.swift b/Tests/GRDBTests/DatabaseQueueTests.swift index b801dc79a..839392606 100644 --- a/Tests/GRDBTests/DatabaseQueueTests.swift +++ b/Tests/GRDBTests/DatabaseQueueTests.swift @@ -54,7 +54,7 @@ class DatabaseQueueTests: GRDBTestCase { XCTAssertEqual(error.description.lowercased(), "sqlite error 1 with statement `select succ(1)`: no such function: succ") } } - + func testAddRemoveCollation() throws { // Adding a collation and then removing it should succeed let dbQueue = try makeDatabaseQueue() @@ -100,6 +100,7 @@ class DatabaseQueueTests: GRDBTestCase { XCTAssertEqual(dbQueue.configuration.label, nil) dbQueue.inDatabase { db in XCTAssertEqual(db.configuration.label, nil) + XCTAssertEqual(db.description, "GRDB.DatabaseQueue") // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. @@ -114,6 +115,7 @@ class DatabaseQueueTests: GRDBTestCase { XCTAssertEqual(dbQueue.configuration.label, "Toreador") dbQueue.inDatabase { db in XCTAssertEqual(db.configuration.label, "Toreador") + XCTAssertEqual(db.description, "Toreador") // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. diff --git a/Tests/GRDBTests/DatabaseSnapshotTests.swift b/Tests/GRDBTests/DatabaseSnapshotTests.swift index 6f4178217..dc7bdb8e2 100644 --- a/Tests/GRDBTests/DatabaseSnapshotTests.swift +++ b/Tests/GRDBTests/DatabaseSnapshotTests.swift @@ -201,6 +201,7 @@ class DatabaseSnapshotTests: GRDBTestCase { let snapshot1 = try dbPool.makeSnapshot() snapshot1.unsafeRead { db in XCTAssertEqual(db.configuration.label, nil) + XCTAssertEqual(db.description, "GRDB.DatabasePool.snapshot.1") // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. @@ -211,6 +212,7 @@ class DatabaseSnapshotTests: GRDBTestCase { let snapshot2 = try dbPool.makeSnapshot() snapshot2.unsafeRead { db in XCTAssertEqual(db.configuration.label, nil) + XCTAssertEqual(db.description, "GRDB.DatabasePool.snapshot.2") // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. @@ -226,6 +228,7 @@ class DatabaseSnapshotTests: GRDBTestCase { let snapshot1 = try dbPool.makeSnapshot() snapshot1.unsafeRead { db in XCTAssertEqual(db.configuration.label, "Toreador") + XCTAssertEqual(db.description, "Toreador.snapshot.1") // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool. @@ -236,6 +239,7 @@ class DatabaseSnapshotTests: GRDBTestCase { let snapshot2 = try dbPool.makeSnapshot() snapshot2.unsafeRead { db in XCTAssertEqual(db.configuration.label, "Toreador") + XCTAssertEqual(db.description, "Toreador.snapshot.2") // This test CAN break in future releases: the dispatch queue labels // are documented to be a debug-only tool.