import Foundation
import ThreemaEssentials
import XCTest
@testable import GroupCalls
final class CallIDTests: XCTestCase {
/// **Protocol Step: Group Call ID Derivation** The Call ID is derived from the group identity and the call start
/// data. Changing it breaks interoperability with all other clients, thus it is pinned to a known answer.
func testCallIDDerivationMatchesKnownAnswer() throws {
// Generated by a known good version
let goldVal = "3b922298c2ad04a5fbef3dfa8270059ee8552789f7194aacb65a3c0e70f79607"
let creatorIdentity = ThreemaIdentity("ECHOECHO")
let groupIdentity = GroupIdentity(id: Data(repeating: 0x00, count: 8), creator: creatorIdentity)
let gck = Data(repeating: 0x01, count: 32)
let sfuBaseURL = URL(string: "sfu.threema.test")!
let groupCallStartData = GroupCallStartData(protocolVersion: 0, gck: gck, sfuBaseURL: sfuBaseURL)
let callID = try XCTUnwrap(try? GroupCallID(
groupIdentity: groupIdentity,
callStartData: groupCallStartData,
dependencies: MockDependencies().create()
))
XCTAssertEqual(callID.bytes.hexEncodedString(), goldVal)
}
}
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-11-04)
¤
*© Formatika GbR, Deutschland