diff --git a/common/events_common.h b/common/events_common.h index 92770d7c..3bcc6675 100644 --- a/common/events_common.h +++ b/common/events_common.h @@ -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); diff --git a/tests/events_common_ut.cpp b/tests/events_common_ut.cpp index 485a9fcd..7df48588 100644 --- a/tests/events_common_ut.cpp +++ b/tests/events_common_ut.cpp @@ -81,10 +81,10 @@ 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 m = {{"foo", "bar"}, {"hello", "world"}, {"good", "day"}}; - map m1, m2; + map m1; EXPECT_EQ(0, zmq_message_send(sock_p0, source, m)); @@ -92,9 +92,6 @@ TEST(events_common, send_recv) 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);