mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
cluster/Event: Hide members behind accessors
This commit is contained in:
parent
90f94ff4f2
commit
214629e054
3 changed files with 31 additions and 9 deletions
|
@ -22,9 +22,9 @@ using namespace zeek::cluster;
|
|||
|
||||
std::optional<broker::zeek::Event> detail::to_broker_event(const detail::Event& ev) {
|
||||
broker::vector xs;
|
||||
xs.reserve(ev.args.size());
|
||||
xs.reserve(ev.Args().size());
|
||||
|
||||
for ( const auto& a : ev.args ) {
|
||||
for ( const auto& a : ev.Args() ) {
|
||||
if ( a->GetType() == zeek::BifType::Record::Broker::Data ) {
|
||||
// When encountering a Broker::Data instance within args, pick out
|
||||
// the broker::data directly to avoid double encoding, Broker::Data.
|
||||
|
@ -40,7 +40,7 @@ std::optional<broker::zeek::Event> detail::to_broker_event(const detail::Event&
|
|||
}
|
||||
}
|
||||
|
||||
return broker::zeek::Event(ev.HandlerName(), xs, broker::to_timestamp(ev.timestamp));
|
||||
return broker::zeek::Event(ev.HandlerName(), xs, broker::to_timestamp(ev.Timestamp()));
|
||||
}
|
||||
|
||||
std::optional<detail::Event> detail::to_zeek_event(const broker::zeek::Event& ev) {
|
||||
|
@ -188,7 +188,7 @@ TEST_CASE("roundtrip") {
|
|||
REQUIRE(result);
|
||||
CHECK_EQ(result->Handler(), handler);
|
||||
CHECK_EQ(result->HandlerName(), "Supervisor::node_status");
|
||||
CHECK_EQ(result->args.size(), 2);
|
||||
CHECK_EQ(result->Args().size(), 2);
|
||||
}
|
||||
|
||||
SUBCASE("binary") {
|
||||
|
@ -211,7 +211,7 @@ TEST_CASE("roundtrip") {
|
|||
REQUIRE(result);
|
||||
CHECK_EQ(result->Handler(), handler);
|
||||
CHECK_EQ(result->HandlerName(), "Supervisor::node_status");
|
||||
CHECK_EQ(result->args.size(), 2);
|
||||
CHECK_EQ(result->Args().size(), 2);
|
||||
}
|
||||
}
|
||||
TEST_SUITE_END();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue