Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Threema/ThreemaTests/   (Social Medium ©)  Datei vom 26.9.2026 mit Größe 1 kB image not shown  

Quelle  CallIDServiceTests.swift   Sprache: JAVA

 

import Testing
@testable import Threema

struct CallIDServiceTests {

    @Test func testUUIDForCallID() async throws {
        let expectedCallIDOne = VoIPCallID.generate()
        let expectedCallIDTwo = VoIPCallID.generate()

        let callIDService = CallIDService()

        let (uuidOne, isNewOne) = callIDService.uuid(for: expectedCallIDOne)
        let (uuidTwo, isNewTwo) = callIDService.uuid(for: expectedCallIDTwo)

        let (uuidOneSecond, isNewOneSecond) = callIDService.uuid(for: expectedCallIDOne)
        let (uuidTwoSecond, isNewTwoSecond) = callIDService.uuid(for: expectedCallIDTwo)

        #expect(isNewOne)
        #expect(!isNewOneSecond)
        #expect(uuidOne == uuidOneSecond)

        #expect(isNewTwo)
        #expect(!isNewTwoSecond)
        #expect(uuidTwo == uuidTwoSecond)

        #expect(uuidOne != uuidTwo)
        #expect(uuidOneSecond != uuidTwoSecond)
    }

    @Test func testCallIDIsNilForUnknownUUID() async throws {
        let callIDService = CallIDService()

        let callID = callIDService.callID(for: UUID())

        #expect(callID == nil)
    }

    @Test func testCallIDForUUID() async throws {
        let expectedCallIDOne = VoIPCallID.generate()
        let expectedCallIDTwo = VoIPCallID.generate()

        let callIDService = CallIDService()

        let (uuidOne, isNewOne) = callIDService.uuid(for: expectedCallIDOne)
        let (uuidTwo, isNewTwo) = callIDService.uuid(for: expectedCallIDTwo)

        #expect(isNewOne)
        #expect(isNewTwo)
        #expect(uuidOne != uuidTwo)

        let callIDOne = callIDService.callID(for: uuidOne)
        let callIDTwo = callIDService.callID(for: uuidTwo)

        #expect(callIDOne?.callID == expectedCallIDOne.callID)
        #expect(callIDTwo?.callID == expectedCallIDTwo.callID)
    }
}

Messung
CHZG
919410094

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-11-04) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.