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

Function TEST

pj_datastore/tests/plugin_data_host_object_read_test.cpp:34–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32};
33
34TEST(ToolboxObjectReadHostTest, ReadsBytesWrittenByWriteHost) {
35 Fixture f;
36 const auto topic = *f.writer.registerTopic("markers", R"({"media_class":"scene"})");
37
38 const std::vector<uint8_t> payload{0x01, 0x02, 0x03, 0x04};
39 ASSERT_TRUE(f.writer.pushOwned(topic, 1000, payload).has_value());
40
41 auto bytes = f.reader.readLatestAt(topic, 1500);
42 ASSERT_TRUE(bytes.has_value()) << bytes.error();
43 ASSERT_TRUE(*bytes);
44 const auto view = bytes->view();
45 EXPECT_EQ(view.size(), payload.size());
46 EXPECT_EQ(std::vector<uint8_t>(view.begin(), view.end()), payload);
47}
48
49TEST(ToolboxObjectReadHostTest, ObjectBytesDestructorReleasesExactlyOnce) {
50 Fixture f;

Callers

nothing calls this directly

Calls 11

pushOwnedMethod · 0.80
entryCountMethod · 0.80
registerTopicMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
evictBeforeMethod · 0.45
listTopicsMethod · 0.45
timeRangeMethod · 0.45
validMethod · 0.45

Tested by

no test coverage detected