mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-22 04:00:39 +00:00
Fast path for String performance decoding test
This commit is contained in:
1 parent
e37c7cf306
commit
550ef55c90
1 file changed
+19
@@ -55,6 +55,25 @@ class FetchStringTests: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
private func measureFetch<Value: DatabaseValueConvertible & StatementColumnConvertible>(
|
||||
of type: Value.Type,
|
||||
from column: String) throws
|
||||
{
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
try dbQueue.read { db in
|
||||
measure {
|
||||
for _ in 0..<Self.fetchesPerIteration {
|
||||
let values = try! Value.fetchCursor(db, sql: "SELECT \(column) FROM item")
|
||||
var count = 0
|
||||
while try! values.next() != nil {
|
||||
count += 1
|
||||
}
|
||||
XCTAssertEqual(count, Self.expectedRowCount)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func measureFetch<Value: DatabaseValueConvertible>(
|
||||
of type: Value.Type,
|
||||
from column: String) throws
|
||||
|
||||
Reference in new issue
Block a user