MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / frame

Function frame

tests/host/ipc/ipc_client_test.cpp:121–137  ·  view source on GitHub ↗

Captures the bytes a MessageComposer would send, without a real socket.

Source from the content-addressed store, hash-verified

119
120// Captures the bytes a MessageComposer would send, without a real socket.
121static std::vector<std::byte> frame(const MessageComposer& c) {
122 struct Cap final : ITransport {
123 std::vector<std::byte> b;
124 void send(std::span<const std::byte> d) override {
125 b.assign(d.begin(), d.end());
126 }
127 std::size_t receive(std::span<std::byte>) override {
128 return 0;
129 }
130 bool has_data() const override {
131 return false;
132 }
133 };
134 Cap cap;
135 c.send(cap);
136 return cap.b;
137}
138
139TEST(IpcClient, PlotBufferContentsUpsertsModel) {
140 FakeTransport t;

Callers 1

TESTFunction · 0.85

Calls 1

sendMethod · 0.45

Tested by

no test coverage detected