Skip to content

Commit 996ebf6

Browse files
Fix tests
1 parent d130249 commit 996ebf6

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

ChatSecureTests/FileTransferIntegrationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class FileTransferIntegrationTests: XCTestCase {
2020

2121
override func setUp() {
2222
super.setUp()
23-
DDLog.add(DDTTYLogger.sharedInstance)
23+
DDTTYLogger.sharedInstance.flatMap { DDLog.add($0) }
2424
if let databaseDirectory = databaseManager?.databaseDirectory {
2525
FileManager.default.clearDirectory(databaseDirectory)
2626
}

ChatSecureTests/OTROMEMOIntegrationTest.swift

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,14 @@ class OTROMEMOIntegrationTest: XCTestCase {
137137

138138
var messageFound = false
139139
self.aliceUser?.databaseManager.writeConnection?.read({ (transaction) in
140-
transaction.enumerateKeysAndObjects(inCollection: OTRBaseMessage.collection, using: { (key, object, stop) in
141-
if let message = object as? OTRBaseMessage {
142-
XCTAssertEqual(message.text, messageText)
143-
messageFound = true
144-
}
145-
146-
})
147-
148-
transaction.enumerateKeysAndObjects(inCollection: OMEMODevice.collection, using: { (key, object, stop) in
149-
let device = object as! OMEMODevice
140+
transaction.iterateKeysAndObjects(inCollection: OTRBaseMessage.collection) { (key, message: OTRBaseMessage, stop) in
141+
XCTAssertEqual(message.text, messageText)
142+
messageFound = true
143+
stop = true
144+
}
145+
transaction.iterateKeysAndObjects(inCollection: OMEMODevice.collection) { (key, device: OMEMODevice, stop) in
150146
XCTAssertNotNil(device.lastSeenDate)
151-
})
152-
147+
}
153148
})
154149
XCTAssertTrue(messageFound,"Found message")
155150
}

0 commit comments

Comments
 (0)