File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -181,28 +181,36 @@ TEST_CASE("message equality non equal lhs empty", "[message]")
181181
182182TEST_CASE (" message rebuild with size" , " [message]" )
183183{
184- const zmq::message_t msg () ;
185- msg.rebuild (5 )
184+ zmq::message_t msg;
185+ msg.rebuild (5 );
186186 CHECK (msg.size () == 5 );
187187}
188188
189189#if defined(ZMQ_CPP11) && !defined(ZMQ_CPP11_PARTIAL)
190+ TEST_CASE (" message rebuild with string literal" , " [message]" )
191+ {
192+ zmq::message_t hi_msg;
193+ hi_msg.rebuild (" Hi" );
194+ REQUIRE (2u == hi_msg.size ());
195+ CHECK (0 == memcmp (data, hi_msg.data (), 2 ));
196+ }
197+
190198TEST_CASE (" message rebuild with strings" , " [message]" )
191199{
192200 SECTION (" string" )
193201 {
194202 const std::string hi (data);
195- zmq::message_t hi_msg () ;
196- hi_msg.rebuild (hi)
203+ zmq::message_t hi_msg;
204+ hi_msg.rebuild (hi);
197205 CHECK (2u == hi_msg.size ());
198206 CHECK (0 == memcmp (data, hi_msg.data (), 2 ));
199207 }
200208#if CPPZMQ_HAS_STRING_VIEW
201209 SECTION (" string_view" )
202210 {
203211 const std::string_view hi (data);
204- zmq::message_t hi_msg () ;
205- hi_msg.rebuild (hi)
212+ zmq::message_t hi_msg;
213+ hi_msg.rebuild (hi);
206214 CHECK (2u == hi_msg.size ());
207215 CHECK (0 == memcmp (data, hi_msg.data (), 2 ));
208216 }
You can’t perform that action at this time.
0 commit comments