mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
This enables easier compilation of a custom version of SQLite that itself uses the SQLITE_HAS_CODEC define. (ex. If building SQLite with the SQLite Encryption Extension.) The SQLITE_HAS_CODEC define is now only used to guard use of the SQLite encryption APIs. GRDBCipher builds define USING_BUILTIN_SQLITE and USING_SQLCIPHER.
32 lines
910 B
Swift
32 lines
910 B
Swift
import XCTest
|
|
import CoreGraphics
|
|
#if USING_SQLCIPHER
|
|
import GRDBCipher
|
|
#elseif USING_CUSTOMSQLITE
|
|
import GRDBCustomSQLite
|
|
#else
|
|
import GRDB
|
|
#endif
|
|
|
|
class CGFloatTests: GRDBTestCase {
|
|
|
|
func testCGFLoat() {
|
|
assertNoError {
|
|
let dbQueue = try makeDatabaseQueue()
|
|
try dbQueue.inDatabase { db in
|
|
try db.execute("CREATE TABLE points (x DOUBLE, y DOUBLE)")
|
|
|
|
let x: CGFloat = 1
|
|
let y: CGFloat? = nil
|
|
try db.execute("INSERT INTO points VALUES (?,?)", arguments: [x, y])
|
|
|
|
let row = Row.fetchOne(db, "SELECT * FROM points")!
|
|
let fetchedX: CGFloat = row.value(named: "x")
|
|
let fetchedY: CGFloat? = row.value(named: "y")
|
|
XCTAssertEqual(x, fetchedX)
|
|
XCTAssertTrue(fetchedY == nil)
|
|
}
|
|
}
|
|
}
|
|
}
|