| 32 | }; |
| 33 | |
| 34 | TEST(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 | |
| 49 | TEST(ToolboxObjectReadHostTest, ObjectBytesDestructorReleasesExactlyOnce) { |
| 50 | Fixture f; |
nothing calls this directly
no test coverage detected