[ntcore] Add cached topic property (#5494)

This commit is contained in:
Joseph Eng
2023-12-10 23:23:36 -08:00
committed by GitHub
parent 192a28af47
commit 8723ee5c39
16 changed files with 316 additions and 34 deletions

View File

@@ -101,6 +101,17 @@ TEST_F(LocalStorageTest, GetTopicInfoUnpublished) {
EXPECT_FALSE(storage.GetTopicExists(fooTopic));
}
TEST_F(LocalStorageTest, DefaultProps) {
EXPECT_CALL(network, Publish(_, fooTopic, std::string_view{"foo"},
std::string_view{"boolean"}, wpi::json::object(),
IsDefaultPubSubOptions()));
storage.Publish(fooTopic, NT_BOOLEAN, "boolean", wpi::json::object(), {});
EXPECT_FALSE(storage.GetTopicPersistent(fooTopic));
EXPECT_FALSE(storage.GetTopicRetained(fooTopic));
EXPECT_TRUE(storage.GetTopicCached(fooTopic));
}
TEST_F(LocalStorageTest, PublishNewNoProps) {
EXPECT_CALL(network, Publish(_, fooTopic, std::string_view{"foo"},
std::string_view{"boolean"}, wpi::json::object(),