MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / TEST

Function TEST

pj_widgets/tests/raster_stream_view_test.cpp:27–41  ·  view source on GitHub ↗

Launch the stub helper through the view; it publishes one frame. Verify the view connects, paints the copied frame, and does not prematurely end the session.

Source from the content-addressed store, hash-verified

25// Launch the stub helper through the view; it publishes one frame. Verify the
26// view connects, paints the copied frame, and does not prematurely end the session.
27TEST(RasterStreamView, ReceivesAStubFrameAndStaysAlive) {
28 PJ::RasterStreamView view;
29 view.resize(320, 200);
30 QSignalSpy ended(&view, &PJ::RasterStreamView::sessionEnded);
31 view.start(QStringLiteral(PJ_STUB_HELPER_PATH), QStringLiteral("/dev/null"));
32
33 bool received_frame = false;
34 for (int attempt = 0; attempt < 60 && !received_frame; ++attempt) {
35 QTest::qWait(50);
36 received_frame = hasPaintedStubFrame(view);
37 }
38
39 EXPECT_TRUE(received_frame);
40 EXPECT_EQ(ended.count(), 0);
41}
42
43} // namespace
44

Callers

nothing calls this directly

Calls 4

hasPaintedStubFrameFunction · 0.85
resizeMethod · 0.45
startMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected