diff --git a/.travis.yml b/.travis.yml index b9f7c27..603f12d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,10 @@ matrix: - os: linux env: ZMQ_VERSION=4.2.0 BUILD_TYPE=pkgconfig + # GCC default, draft disabled, latest 4.2.x libzmq (defined in ci_build.sh) + - os: linux + env: ZMQ_VERSION=4.2.5 + # GCC default, draft disabled, default libzmq (defined in ci_build.sh) - os: linux diff --git a/README.md b/README.md index 32191eb..9d3c253 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,10 @@ Supported platforms =================== - Only a subset of the platforms that are supported by libzmq itself are supported. Some features already require a compiler supporting C++11. In the future, probably all features will require C++11. To build and run the tests, CMake and Catch are required. - - Tested libzmq versions are + - Any libzmq 4.x version is expected to work. DRAFT features may only work for the most recent tested version. Currently explicitly tested libzmq versions are - 4.2.0 (without DRAFT API) - - 4.2.5 (with and without DRAFT API) + - 4.2.5 (without DRAFT API) + - 4.3.1 (with and without DRAFT API) - Platforms with full support (i.e. CI executing build and tests) - Ubuntu 14.04 x64 (with gcc 4.8.4) (without DRAFT API only) - Ubuntu 14.04 x64 (with gcc 7.3.0) diff --git a/ci_build.sh b/ci_build.sh index c900f57..e2beb49 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -4,7 +4,7 @@ set -x set -e BUILD_TYPE=${BUILD_TYPE:-cmake} -ZMQ_VERSION=${ZMQ_VERSION:-4.2.5} +ZMQ_VERSION=${ZMQ_VERSION:-4.3.1} ENABLE_DRAFTS=${ENABLE_DRAFTS:-OFF} COVERAGE=${COVERAGE:-OFF} LIBZMQ=${PWD}/libzmq-build diff --git a/tests/active_poller.cpp b/tests/active_poller.cpp index 2e921bb..96a76a1 100644 --- a/tests/active_poller.cpp +++ b/tests/active_poller.cpp @@ -83,20 +83,20 @@ TEST_CASE("add handler", "[active_poller]") CHECK_NOTHROW(active_poller.add(socket, ZMQ_POLLIN, handler)); } +#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 3, 0) +// this behaviour was added by https://github.com/zeromq/libzmq/pull/3100 TEST_CASE("add handler invalid events type", "[active_poller]") { - /// \todo is it good that this is accepted? should probably already be - /// checked by zmq_poller_add/modify in libzmq: - /// https://github.com/zeromq/libzmq/issues/3088 zmq::context_t context; zmq::socket_t socket{context, zmq::socket_type::router}; zmq::active_poller_t active_poller; zmq::active_poller_t::handler_t handler; short invalid_events_type = 2 << 10; - CHECK_NOTHROW(active_poller.add(socket, invalid_events_type, handler)); - CHECK_FALSE(active_poller.empty()); - CHECK(1u == active_poller.size()); + CHECK_THROWS_AS(active_poller.add(socket, invalid_events_type, handler), zmq::error_t); + CHECK(active_poller.empty()); + CHECK(0u == active_poller.size()); } +#endif TEST_CASE("add handler twice throws", "[active_poller]") { diff --git a/tests/poller.cpp b/tests/poller.cpp index a42fd66..47689b3 100644 --- a/tests/poller.cpp +++ b/tests/poller.cpp @@ -66,17 +66,17 @@ TEST_CASE("poller add non nullptr", "[poller]") CHECK_NOTHROW(poller.add(socket, ZMQ_POLLIN, &i)); } +#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 3, 0) +// this behaviour was added by https://github.com/zeromq/libzmq/pull/3100 TEST_CASE("poller add handler invalid events type", "[poller]") { - /// \todo is it good that this is accepted? should probably already be - /// checked by zmq_poller_add/modify in libzmq: - /// https://github.com/zeromq/libzmq/issues/3088 zmq::context_t context; zmq::socket_t socket{context, zmq::socket_type::router}; zmq::poller_t<> poller; short invalid_events_type = 2 << 10; - CHECK_NOTHROW(poller.add(socket, invalid_events_type, nullptr)); + CHECK_THROWS_AS(poller.add(socket, invalid_events_type, nullptr), zmq::error_t); } +#endif TEST_CASE("poller add handler twice throws", "[poller]") {