3 #include <catch2/catch_all.hpp>
10 socket.
bind(
"tcp://127.0.0.1:*");
12 endpoint.resize(socket.get(zmq::sockopt::last_endpoint,
zmq::buffer(endpoint)));
16 struct common_server_client_setup
18 common_server_client_setup(
bool initialize =
true)
26 endpoint = bind_ip4_loopback(
server);
27 REQUIRE_NOTHROW(
client.connect(endpoint));
37 #define CHECK_THROWS_ZMQ_ERROR(ecode, expr) \
43 catch (const zmq::error_t &ze) { \
44 INFO(std::string("Unexpected error code: ") + ze.what()); \
45 CHECK(ze.num() == ecode); \
47 catch (const std::exception &ex) { \
48 INFO(std::string("Unexpected exception: ") + ex.what()); \