#include #include #include #include #include #include #include #include #include #include #include using namespace async_mqtt5; BOOST_AUTO_TEST_SUITE(traits/*, *boost::unit_test::disabled()*/) struct good_authenticator { good_authenticator() = default; template decltype(auto) async_auth( auth_step_e step, std::string data, CompletionToken&& token ) { using error_code = boost::system::error_code; using Signature = void(error_code, std::string); auto initiate = [](auto, auth_step_e, std::string) {}; return asio::async_initiate( initiate, token, step, std::move(data) ); } std::string_view method() const { return "method"; } }; struct bad_authenticator { bad_authenticator() = default; void async_auth(std::string /* data */) {} std::string_view method() const { return "method"; } }; BOOST_AUTO_TEST_CASE(is_authenticator) { BOOST_STATIC_ASSERT(detail::is_authenticator); BOOST_STATIC_ASSERT(!detail::is_authenticator); } namespace asio = boost::asio; namespace beast = boost::beast; using tcp_layer = asio::ip::tcp::socket; using tls_layer = asio::ssl::stream; using websocket_tcp_layer = beast::websocket::stream; using websocket_tls_layer = beast::websocket::stream; BOOST_AUTO_TEST_CASE(has_next_layer) { BOOST_STATIC_ASSERT(!detail::has_next_layer); BOOST_STATIC_ASSERT(detail::has_next_layer); BOOST_STATIC_ASSERT(detail::has_next_layer); BOOST_STATIC_ASSERT(detail::has_next_layer); } BOOST_AUTO_TEST_CASE(has_tls_layer) { BOOST_STATIC_ASSERT(!detail::has_tls_layer); BOOST_STATIC_ASSERT(detail::has_tls_layer); BOOST_STATIC_ASSERT(!detail::has_tls_layer); BOOST_STATIC_ASSERT(detail::has_tls_layer); } BOOST_AUTO_TEST_CASE(has_tls_handshake) { BOOST_STATIC_ASSERT(!detail::has_tls_handshake); BOOST_STATIC_ASSERT(detail::has_tls_handshake); BOOST_STATIC_ASSERT(!detail::has_tls_handshake); BOOST_STATIC_ASSERT(!detail::has_tls_handshake); } BOOST_AUTO_TEST_CASE(has_ws_handskae) { BOOST_STATIC_ASSERT(!detail::has_ws_handshake); BOOST_STATIC_ASSERT(!detail::has_ws_handshake); BOOST_STATIC_ASSERT(detail::has_ws_handshake); BOOST_STATIC_ASSERT(detail::has_ws_handshake); } BOOST_AUTO_TEST_SUITE_END();