mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-12-24 06:14:34 +01:00
Document macro usage and simplify code
This commit is contained in:
@@ -222,7 +222,7 @@ TEST_CASE("mutable_buffer creation string", "[buffer]")
|
||||
CHECK(b2.data() == d.data());
|
||||
}
|
||||
|
||||
#ifdef ZMQ_CPP17
|
||||
#if CPPZMQ_HAS_STRING_VIEW
|
||||
TEST_CASE("const_buffer creation string_view", "[buffer]")
|
||||
{
|
||||
std::wstring dstr(10, L'a');
|
||||
|
||||
@@ -158,7 +158,7 @@ TEST_CASE("message to string", "[message]")
|
||||
const zmq::message_t b("Foo", 3);
|
||||
CHECK(a.to_string() == "");
|
||||
CHECK(b.to_string() == "Foo");
|
||||
#ifdef ZMQ_CPP17
|
||||
#if CPPZMQ_HAS_STRING_VIEW
|
||||
CHECK(a.to_string_view() == "");
|
||||
CHECK(b.to_string_view() == "Foo");
|
||||
#endif
|
||||
|
||||
@@ -69,7 +69,7 @@ TEST_CASE("socket options", "[socket]")
|
||||
socket.set(zmq::sockopt::routing_id, "foobar");
|
||||
socket.set(zmq::sockopt::routing_id, zmq::buffer(id));
|
||||
socket.set(zmq::sockopt::routing_id, id);
|
||||
#if defined(ZMQ_HAS_STRING_VIEW) && (ZMQ_HAS_STRING_VIEW > 0)
|
||||
#if CPPZMQ_HAS_STRING_VIEW
|
||||
socket.set(zmq::sockopt::routing_id, std::string_view{id});
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user