Skip to content

Commit f86fd45

Browse files
committed
Fix CipherTests
1 parent 135ce68 commit f86fd45

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Tests/SQLiteTests/Extensions/CipherTests.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CipherTests: XCTestCase {
1919

2020
// db2
2121
let key2 = keyData()
22-
try db2.key(Blob(data: key2))
22+
try db2.key(Blob(bytes: key2.bytes, length: key2.length))
2323

2424
try db2.run("CREATE TABLE foo (bar TEXT)")
2525
try db2.run("INSERT INTO foo (bar) VALUES ('world')")
@@ -47,7 +47,7 @@ class CipherTests: XCTestCase {
4747

4848
func test_data_rekey() throws {
4949
let newKey = keyData()
50-
try db2.rekey(Blob(data: newKey))
50+
try db2.rekey(Blob(bytes: newKey.bytes, length: newKey.length))
5151
XCTAssertEqual(1, try db2.scalar("SELECT count(*) FROM foo") as? Int64)
5252
}
5353

@@ -79,12 +79,11 @@ class CipherTests: XCTestCase {
7979
// sqlite> CREATE TABLE foo (bar TEXT);
8080
// sqlite> INSERT INTO foo (bar) VALUES ('world');
8181
guard let cipherVersion: String = db1.cipherVersion,
82-
cipherVersion.starts(with: "3.") || cipherVersion.starts(with: "4.")
83-
else { return }
82+
cipherVersion.starts(with: "3.") || cipherVersion.starts(with: "4.") else { return }
8483

8584
let encryptedFile = cipherVersion.starts(with: "3.") ?
86-
fixture("encrypted-3.x", withExtension: "sqlite") :
87-
fixture("encrypted-4.x", withExtension: "sqlite")
85+
fixture("encrypted-3.x", withExtension: "sqlite") :
86+
fixture("encrypted-4.x", withExtension: "sqlite")
8887

8988
try FileManager.default.setAttributes([FileAttributeKey.immutable: 1], ofItemAtPath: encryptedFile)
9089
XCTAssertFalse(FileManager.default.isWritableFile(atPath: encryptedFile))

0 commit comments

Comments
 (0)