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

Function TEST

pj_datastore/tests/plugin_data_host_object_test.cpp:31–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29};
30
31TEST(PluginDataHostObjectTest, RegisterTopicReturnsUsableHandle) {
32 Fixture f;
33 auto handle = f.host.registerTopic("markers", R"({"media_class":"scene"})");
34 ASSERT_TRUE(handle.has_value()) << handle.error();
35 EXPECT_NE(handle->id, 0U);
36
37 // Metadata round-trips through the store.
38 const auto topics = f.store.listTopics(kDatasetId);
39 ASSERT_EQ(topics.size(), 1U);
40 const auto& desc = f.store.descriptor(topics[0]);
41 EXPECT_EQ(desc.topic_name, "markers");
42 EXPECT_EQ(desc.metadata_json, R"({"media_class":"scene"})");
43 EXPECT_EQ(desc.dataset_id, kDatasetId);
44}
45
46TEST(PluginDataHostObjectTest, RegisterTopicRejectsDuplicateName) {
47 Fixture f;

Callers

nothing calls this directly

Calls 15

descriptorMethod · 0.80
pushOwnedMethod · 0.80
entryCountMethod · 0.80
pushLazyMethod · 0.80
setRetentionBudgetMethod · 0.80
setTargetMethod · 0.80
registerTopicMethod · 0.45
listTopicsMethod · 0.45
sizeMethod · 0.45
latestAtMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected