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

Quelle  EventEnricherTests.swift   Sprache: JAVA

 

import Sentry
import Testing
@testable import Threema

@MainActor
struct EventEnricherTests {

    @Test("Derives an anonymized user from the app device hash")
    func derivesAnonymizedUserFromAppDeviceHash() {
        var savedAppDevice: String?
        let enricher = EventEnricher(saveAppDevice: { savedAppDevice = $0 })

        let event = Sentry.Event()
        event.context = ["app": ["device_app_hash": "abc123"]]

        enricher.enrich(event)

        #expect(savedAppDevice == "abc123")
        // swiftformat:disable:next acronyms
        #expect(event.user?.userId == "abc123")
    }

    @Test("Leaves the event alone when it carries no app device hash")
    func withoutAppDeviceHash() {
        var savedAppDevice: String?
        let enricher = EventEnricher(saveAppDevice: { savedAppDevice = $0 })

        let event = Sentry.Event()
        event.context = ["app": [:]]

        enricher.enrich(event)

        #expect(savedAppDevice == nil)
        #expect(event.user == nil)
    }
}

Messung
CHZG
100100100100

¤ Dauer der Verarbeitung: 0.0 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.