Skip to content

Commit b3a21ca

Browse files
committed
Avoid NSMutableData
1 parent 932d580 commit b3a21ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/SQLiteTests/Extensions/CipherTests.swift

Lines changed: 4 additions & 4 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(bytes: key2.bytes, length: key2.length))
22+
try db2.key(Blob(data: key2))
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(bytes: newKey.bytes, length: newKey.length))
50+
try db2.rekey(Blob(data: newKey))
5151
XCTAssertEqual(1, try db2.scalar("SELECT count(*) FROM foo") as? Int64)
5252
}
5353

@@ -108,12 +108,12 @@ class CipherTests: XCTestCase {
108108
XCTAssertEqual(1, try conn.scalar("SELECT count(*) FROM foo") as? Int64)
109109
}
110110

111-
private func keyData(length: Int = 64) -> NSMutableData {
111+
private func keyData(length: Int = 64) -> NSData {
112112
let keyData = NSMutableData(length: length)!
113113
let result = SecRandomCopyBytes(kSecRandomDefault, length,
114114
keyData.mutableBytes.assumingMemoryBound(to: UInt8.self))
115115
XCTAssertEqual(0, result)
116-
return keyData
116+
return NSData(data: keyData)
117117
}
118118
}
119119
#endif

0 commit comments

Comments
 (0)