Skip to content
Snippets Groups Projects
Commit 003644bc authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add E2EPartitionSize functor

parent 6b09d25c
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!18Update Bindings
...@@ -4,6 +4,7 @@ public struct E2E { ...@@ -4,6 +4,7 @@ public struct E2E {
public var getId: E2EGetId public var getId: E2EGetId
public var getReceptionId: E2EGetReceptionId public var getReceptionId: E2EGetReceptionId
public var payloadSize: E2EPayloadSize public var payloadSize: E2EPayloadSize
public var partitionSize: E2EPartitionSize
// TODO: // TODO:
} }
...@@ -13,7 +14,8 @@ extension E2E { ...@@ -13,7 +14,8 @@ extension E2E {
E2E( E2E(
getId: .live(bindingsE2E: bindingsE2E), getId: .live(bindingsE2E: bindingsE2E),
getReceptionId: .live(bindingsE2E: bindingsE2E), getReceptionId: .live(bindingsE2E: bindingsE2E),
payloadSize: .live(bindingsE2E: bindingsE2E) payloadSize: .live(bindingsE2E: bindingsE2E),
partitionSize: .live(bindingsE2E: bindingsE2E)
) )
} }
} }
...@@ -22,6 +24,7 @@ extension E2E { ...@@ -22,6 +24,7 @@ extension E2E {
public static let unimplemented = E2E( public static let unimplemented = E2E(
getId: .unimplemented, getId: .unimplemented,
getReceptionId: .unimplemented, getReceptionId: .unimplemented,
payloadSize: .unimplemented payloadSize: .unimplemented,
partitionSize: .unimplemented
) )
} }
import Bindings
import XCTestDynamicOverlay
public struct E2EPartitionSize {
public var first: () -> Int
public var second: () -> Int
public var atIndex: (Int) -> Int
subscript(payloadIndex payloadIndex: Int) -> Int {
atIndex(payloadIndex)
}
}
extension E2EPartitionSize {
public static func live(bindingsE2E: BindingsE2e) -> E2EPartitionSize {
E2EPartitionSize(
first: bindingsE2E.firstPartitionSize,
second: bindingsE2E.secondPartitionSize,
atIndex: bindingsE2E.partitionSize(_:)
)
}
}
extension E2EPartitionSize {
public static let unimplemented = E2EPartitionSize(
first: XCTUnimplemented("\(Self.self).first"),
second: XCTUnimplemented("\(Self.self).second"),
atIndex: XCTUnimplemented("\(Self.self).atIndex")
)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment