2018-09-23 18:14:25 +02:00
|
|
|
#include <catch.hpp>
|
2018-03-29 18:14:34 +02:00
|
|
|
#include <zmq.hpp>
|
2018-03-29 17:34:21 +02:00
|
|
|
|
2019-04-02 16:01:10 +02:00
|
|
|
#if (__cplusplus >= 201703L)
|
|
|
|
static_assert(std::is_nothrow_swappable<zmq::context_t>::value,
|
|
|
|
"context_t should be nothrow swappable");
|
|
|
|
#endif
|
|
|
|
|
2018-09-23 18:14:25 +02:00
|
|
|
TEST_CASE("context construct default and destroy", "[context]")
|
2018-03-29 17:34:21 +02:00
|
|
|
{
|
2018-03-29 18:14:34 +02:00
|
|
|
zmq::context_t context;
|
2018-04-02 13:15:34 +02:00
|
|
|
}
|
|
|
|
|
2018-09-23 18:14:25 +02:00
|
|
|
TEST_CASE("context create, close and destroy", "[context]")
|
2018-04-02 13:15:34 +02:00
|
|
|
{
|
|
|
|
zmq::context_t context;
|
2018-05-12 18:28:28 +02:00
|
|
|
context.close();
|
2018-09-23 18:14:25 +02:00
|
|
|
CHECK(NULL == (void *) context);
|
2018-04-02 13:15:34 +02:00
|
|
|
}
|
2019-04-02 16:01:10 +02:00
|
|
|
|
|
|
|
#ifdef ZMQ_CPP11
|
|
|
|
TEST_CASE("context swap", "[context]")
|
|
|
|
{
|
|
|
|
zmq::context_t context1;
|
|
|
|
zmq::context_t context2;
|
|
|
|
using std::swap;
|
|
|
|
swap(context1, context2);
|
|
|
|
}
|
|
|
|
#endif
|