Skip to content

Commit

Permalink
Merge branch 'master' into master-add-fabric-monitor-tables
Browse files Browse the repository at this point in the history
  • Loading branch information
jfeng-arista authored Sep 20, 2023
2 parents fc3de5a + 5056f40 commit 198c245
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 1 addition & 3 deletions common/events_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,7 @@ struct serialization
int
deserialize(const string& s, Map& data)
{
if (s.size() < 2) { // zmq identifying message of length 1
return 0;
}

try {
istringstream ss(s);
boost::archive::text_iarchive iarch(ss);
Expand Down
7 changes: 2 additions & 5 deletions tests/events_common_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,17 @@ TEST(events_common, send_recv)
void *sock_p1 = zmq_socket (zmq_ctx, ZMQ_PAIR);
EXPECT_EQ(0, zmq_bind (sock_p1, path));

string source("Hello"), source1, source2("#");
string source("Hello"), source1;

map<string, string> m = {{"foo", "bar"}, {"hello", "world"}, {"good", "day"}};
map<string, string> m1, m2;
map<string, string> m1;

EXPECT_EQ(0, zmq_message_send(sock_p0, source, m));

EXPECT_EQ(0, zmq_message_read(sock_p1, 0, source1, m1));

EXPECT_EQ(source, source1);
EXPECT_EQ(m, m1);

EXPECT_EQ(0, deserialize(source2, m2));

zmq_close(sock_p0);
zmq_close(sock_p1);
zmq_ctx_term(zmq_ctx);
Expand Down

0 comments on commit 198c245

Please sign in to comment.