diff --git a/Tests/GRDBTests/DatabasePoolReleaseMemoryTests.swift b/Tests/GRDBTests/DatabasePoolReleaseMemoryTests.swift index f4c9f5c5e..491fb1199 100644 --- a/Tests/GRDBTests/DatabasePoolReleaseMemoryTests.swift +++ b/Tests/GRDBTests/DatabasePoolReleaseMemoryTests.swift @@ -188,39 +188,6 @@ class DatabasePoolReleaseMemoryTests: GRDBTestCase { XCTAssertEqual(openConnectionCount, 0) } - // TODO: this test should be duplicated for all cursor types - func testDatabaseCursorRetainSQLiteConnection() throws { - let countQueue = DispatchQueue(label: "GRDB") - var openConnectionCount = 0 - - dbConfiguration.SQLiteConnectionDidOpen = { - countQueue.sync { - openConnectionCount += 1 - } - } - - dbConfiguration.SQLiteConnectionDidClose = { - countQueue.sync { - openConnectionCount -= 1 - } - } - - var cursor: FastDatabaseValueCursor? = nil - do { - try! makeDatabasePool().write { db in - try db.execute("CREATE TABLE items (id INTEGER PRIMARY KEY)") - try db.execute("INSERT INTO items (id) VALUES (NULL)") - try db.execute("INSERT INTO items (id) VALUES (NULL)") - cursor = try Int.fetchCursor(db, "SELECT id FROM items") - XCTAssertTrue(try cursor!.next() != nil) - XCTAssertEqual(openConnectionCount, 1) - } - } - XCTAssertEqual(openConnectionCount, 0) - XCTAssertTrue(try! cursor!.next() != nil) - XCTAssertTrue(try! cursor!.next() == nil) - } - func testStatementDoNotRetainDatabaseConnection() throws { // Block 1 Block 2 // create statement INSERT diff --git a/Tests/GRDBTests/DatabaseQueueReleaseMemoryTests.swift b/Tests/GRDBTests/DatabaseQueueReleaseMemoryTests.swift index 7f2426350..08707fd51 100644 --- a/Tests/GRDBTests/DatabaseQueueReleaseMemoryTests.swift +++ b/Tests/GRDBTests/DatabaseQueueReleaseMemoryTests.swift @@ -102,39 +102,6 @@ class DatabaseQueueReleaseMemoryTests: GRDBTestCase { // All connections are closed XCTAssertEqual(openConnectionCount, 0) } - - // TODO: this test should be duplicated for all cursor types - func testDatabaseCursorRetainSQLiteConnection() throws { - let countQueue = DispatchQueue(label: "GRDB") - var openConnectionCount = 0 - - dbConfiguration.SQLiteConnectionDidOpen = { - countQueue.sync { - openConnectionCount += 1 - } - } - - dbConfiguration.SQLiteConnectionDidClose = { - countQueue.sync { - openConnectionCount -= 1 - } - } - - var cursor: FastDatabaseValueCursor? = nil - do { - try! makeDatabaseQueue().inDatabase { db in - try db.execute("CREATE TABLE items (id INTEGER PRIMARY KEY)") - try db.execute("INSERT INTO items (id) VALUES (NULL)") - try db.execute("INSERT INTO items (id) VALUES (NULL)") - cursor = try Int.fetchCursor(db, "SELECT id FROM items") - XCTAssertTrue(try cursor!.next() != nil) - XCTAssertEqual(openConnectionCount, 1) - } - } - XCTAssertEqual(openConnectionCount, 0) - XCTAssertTrue(try! cursor!.next() != nil) - XCTAssertTrue(try! cursor!.next() == nil) - } func testStatementDoNotRetainDatabaseConnection() throws { // Block 1 Block 2