If a user's database is corrupted, we now try to fix it. I recommend reviewing `DatabaseRecovery` to see how this works, and `DatabaseRecoveryViewController` for the bulk of the UI.
23 lines
716 B
Swift
23 lines
716 B
Swift
//
|
|
// Copyright (c) 2022 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
import XCTest
|
|
import SignalServiceKit
|
|
|
|
final class GRDBDatabaseStorageAdapterTest: XCTestCase {
|
|
func testWalFileUrl() throws {
|
|
let input = URL(fileURLWithPath: "/tmp/foo.db")
|
|
let expected = URL(fileURLWithPath: "/tmp/foo.db-wal")
|
|
let actual = GRDBDatabaseStorageAdapter.walFileUrl(for: input)
|
|
XCTAssertEqual(actual, expected)
|
|
}
|
|
|
|
func testShmFileUrl() throws {
|
|
let input = URL(fileURLWithPath: "/tmp/foo.db")
|
|
let expected = URL(fileURLWithPath: "/tmp/foo.db-shm")
|
|
let actual = GRDBDatabaseStorageAdapter.shmFileUrl(for: input)
|
|
XCTAssertEqual(actual, expected)
|
|
}
|
|
}
|