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

Quelle  DataBackupMock.swift   Sprache: JAVA

 

import DataBackup
import os

public struct DataBackupMock: DataBackupProtocol {

    // MARK: - Public types

    public enum Call: Equatable, Sendable {
        case perform
    }

    // MARK: - Private types

    private struct State {
        var calls: [Call] = []
        var mockPerform: @Sendable () throws -> Void = { /* no-op */ }
    }

    // MARK: - Private properties

    private let state = OSAllocatedUnfairLock<State>(initialState: State())

    // MARK: - Lifecycle

    public init() { /* no-op */ }

    // MARK: - Public properties

    public var mockPerform: @Sendable () throws -> Void {
        get { state.withLock { $0.mockPerform } }
        set { state.withLock { $0.mockPerform = newValue } }
    }

    public var calls: [Call] {
        state.withLock { $0.calls }
    }

    // MARK: - Public methods

    public func reset() {
        state.withLock { $0.calls.removeAll() }
    }

    public func perform() async throws {
        let stub: @Sendable () throws -> Void = state.withLock {
            $0.calls.append(.perform)
            return $0.mockPerform
        }
        return try stub()
    }
}

Messung
CHZG
849710093

¤ 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.