MCPcopy Create free account
hub / github.com/Snapchat/Valdi / TEST

Function TEST

valdi/test/runtime/DebuggerService_tests.cpp:201–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199};
200
201TEST(DebuggerService, canConnectAndDisconnect) {
202 DebuggerServiceWrapper wrapper;
203
204 wrapper.service->addListener(wrapper.listener.get());
205
206 wrapper.service->start();
207
208 auto client = makeShared<TCPClient>();
209 auto tcpListener = makeShared<MockTCPClientListener>();
210
211 Ref<ITCPConnection> connection;
212
213 wrapper.connectToService(client, tcpListener, connection);
214
215 ASSERT_TRUE(connection != nullptr);
216
217 connection->close(Error("Disconnect"));
218
219 auto daemonClientDisconnected = wrapper.listener->dequeueNextEvent();
220
221 ASSERT_EQ(DebuggerServiceEventTypeDaemonClientDisconnected, daemonClientDisconnected.type);
222
223 client->disconnect();
224}
225
226TEST(DebuggerService, canReceiveUpdatedResources) {
227 DebuggerServiceWrapper wrapper;

Callers

nothing calls this directly

Calls 15

valueToJsonFunction · 0.85
connectToServiceMethod · 0.80
dequeueNextEventMethod · 0.80
descriptionMethod · 0.80
getMapValueMethod · 0.80
getBridgeLoggerMethod · 0.80
addListenerMethod · 0.65
getMethod · 0.65
startMethod · 0.65
closeMethod · 0.65
disconnectMethod · 0.65
valueMethod · 0.65

Tested by

no test coverage detected