mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
Update checkpointing tests
This commit is contained in:
1 parent
56f6984f9d
commit
6f3ec89bcd
2 files changed
+8
-8
No files matched your search
@@ -442,8 +442,8 @@ class DatabasePoolConcurrencyTests: GRDBTestCase {
|
||||
defer { s2.signal() }
|
||||
try dbPool.writeWithoutTransaction { db in
|
||||
try db.execute(sql: "DELETE FROM items")
|
||||
try db.checkpoint()
|
||||
}
|
||||
try dbPool.checkpoint()
|
||||
} catch {
|
||||
XCTFail("error: \(error)")
|
||||
}
|
||||
@@ -538,8 +538,8 @@ class DatabasePoolConcurrencyTests: GRDBTestCase {
|
||||
defer { s2.signal() }
|
||||
try dbPool.writeWithoutTransaction { db in
|
||||
try db.execute(sql: "INSERT INTO items (id) VALUES (NULL)")
|
||||
try db.checkpoint()
|
||||
}
|
||||
try dbPool.checkpoint()
|
||||
} catch {
|
||||
XCTFail("error: \(error)")
|
||||
}
|
||||
@@ -759,8 +759,8 @@ class DatabasePoolConcurrencyTests: GRDBTestCase {
|
||||
defer { s2.signal() }
|
||||
try dbPool.writeWithoutTransaction { db in
|
||||
try db.execute(sql: "DELETE FROM items")
|
||||
try db.checkpoint()
|
||||
}
|
||||
try dbPool.checkpoint()
|
||||
} catch {
|
||||
XCTFail("error: \(error)")
|
||||
}
|
||||
@@ -803,8 +803,8 @@ class DatabasePoolConcurrencyTests: GRDBTestCase {
|
||||
defer { s2.signal() }
|
||||
try dbPool.writeWithoutTransaction { db in
|
||||
try db.execute(sql: "INSERT INTO items (id) VALUES (NULL)")
|
||||
try db.checkpoint()
|
||||
}
|
||||
try dbPool.checkpoint()
|
||||
} catch {
|
||||
XCTFail("error: \(error)")
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ class DatabaseSnapshotTests: GRDBTestCase {
|
||||
let counter = try Counter(dbPool: dbPool)
|
||||
try dbPool.write(counter.increment)
|
||||
let snapshot = try dbPool.makeSnapshot()
|
||||
try? dbPool.checkpoint(.passive) // ignore if error or not, that's not the point
|
||||
try? dbPool.writeWithoutTransaction { _ = try $0.checkpoint(.passive) } // ignore if error or not, that's not the point
|
||||
try XCTAssertEqual(snapshot.read(counter.value), 1)
|
||||
try dbPool.write(counter.increment)
|
||||
try XCTAssertEqual(snapshot.read(counter.value), 1)
|
||||
@@ -281,7 +281,7 @@ class DatabaseSnapshotTests: GRDBTestCase {
|
||||
let counter = try Counter(dbPool: dbPool)
|
||||
try dbPool.write(counter.increment)
|
||||
let snapshot = try dbPool.makeSnapshot()
|
||||
try? dbPool.checkpoint(.full) // ignore if error or not, that's not the point
|
||||
try? dbPool.writeWithoutTransaction { _ = try $0.checkpoint(.full) } // ignore if error or not, that's not the point
|
||||
try XCTAssertEqual(snapshot.read(counter.value), 1)
|
||||
try dbPool.write(counter.increment)
|
||||
try XCTAssertEqual(snapshot.read(counter.value), 1)
|
||||
@@ -292,7 +292,7 @@ class DatabaseSnapshotTests: GRDBTestCase {
|
||||
let counter = try Counter(dbPool: dbPool)
|
||||
try dbPool.write(counter.increment)
|
||||
let snapshot = try dbPool.makeSnapshot()
|
||||
try? dbPool.checkpoint(.restart) // ignore if error or not, that's not the point
|
||||
try? dbPool.writeWithoutTransaction { _ = try $0.checkpoint(.restart) } // ignore if error or not, that's not the point
|
||||
try XCTAssertEqual(snapshot.read(counter.value), 1)
|
||||
try dbPool.write(counter.increment)
|
||||
try XCTAssertEqual(snapshot.read(counter.value), 1)
|
||||
@@ -303,7 +303,7 @@ class DatabaseSnapshotTests: GRDBTestCase {
|
||||
let counter = try Counter(dbPool: dbPool)
|
||||
try dbPool.write(counter.increment)
|
||||
let snapshot = try dbPool.makeSnapshot()
|
||||
try? dbPool.checkpoint(.truncate) // ignore if error or not, that's not the point
|
||||
try? dbPool.writeWithoutTransaction { _ = try $0.checkpoint(.truncate) } // ignore if error or not, that's not the point
|
||||
try XCTAssertEqual(snapshot.read(counter.value), 1)
|
||||
try dbPool.write(counter.increment)
|
||||
try XCTAssertEqual(snapshot.read(counter.value), 1)
|
||||
|
||||
Reference in new issue
Block a user