#include <boost/test/unit_test.hpp>
#include "connection_tu2.hpp"
#include <websocketpp/transport/debug/endpoint.hpp>
Go to the source code of this file.
Classes | |
struct | connection_extension |
struct | stub_config |
struct | debug_config_client |
struct | debug_config_client::transport_config |
struct | connection_setup |
Macros | |
#define | BOOST_TEST_MODULE connection |
Typedefs | |
typedef websocketpp::client< debug_config_client > | debug_client |
typedef websocketpp::server< debug_config_client > | debug_server |
Functions | |
BOOST_AUTO_TEST_CASE (basic_http_request) | |
void | validate_func (server *s, websocketpp::connection_hdl hdl, message_ptr msg) |
bool | validate_set_ua (server *s, websocketpp::connection_hdl hdl) |
void | http_func (server *s, websocketpp::connection_hdl hdl) |
void | defer_http_func (server *s, bool *deferred, websocketpp::connection_hdl hdl) |
void | check_on_fail (server *s, websocketpp::lib::error_code ec, bool &called, websocketpp::connection_hdl hdl) |
void | on_open_print (server *s, websocketpp::connection_hdl hdl) |
void | fail_on_open (websocketpp::connection_hdl) |
void | fail_on_http (websocketpp::connection_hdl) |
BOOST_AUTO_TEST_CASE (connection_extensions) | |
BOOST_AUTO_TEST_CASE (basic_websocket_request) | |
BOOST_AUTO_TEST_CASE (http_request) | |
BOOST_AUTO_TEST_CASE (deferred_http_request) | |
BOOST_AUTO_TEST_CASE (request_no_server_header) | |
BOOST_AUTO_TEST_CASE (request_no_server_header_override) | |
BOOST_AUTO_TEST_CASE (basic_client_websocket) | |
BOOST_AUTO_TEST_CASE (set_max_message_size) | |
BOOST_AUTO_TEST_CASE (websocket_fail_parse_error) | |
BOOST_AUTO_TEST_CASE (websocket_fail_invalid_version) | |
BOOST_AUTO_TEST_CASE (websocket_fail_unsupported_version) | |
BOOST_AUTO_TEST_CASE (websocket_fail_upgrade_required) | |
BOOST_AUTO_TEST_CASE (client_handshake_timeout_race1) | |
BOOST_AUTO_TEST_CASE (client_handshake_timeout_race2) | |
BOOST_AUTO_TEST_CASE (server_handshake_timeout_race1) | |
BOOST_AUTO_TEST_CASE (server_handshake_timeout_race2) | |
#define BOOST_TEST_MODULE connection |
Definition at line 28 of file connection.cpp.
Definition at line 147 of file connection.cpp.
Definition at line 148 of file connection.cpp.
BOOST_AUTO_TEST_CASE | ( | basic_http_request | ) |
Definition at line 41 of file connection.cpp.
References run_server_test(), and websocketpp::user_agent.
void validate_func | ( | server * | s, |
websocketpp::connection_hdl | hdl, | ||
message_ptr | msg | ||
) |
Definition at line 154 of file connection.cpp.
References websocketpp::endpoint< connection, config >::send().
bool validate_set_ua | ( | server * | s, |
websocketpp::connection_hdl | hdl | ||
) |
Definition at line 158 of file connection.cpp.
References websocketpp::endpoint< connection, config >::get_con_from_hdl().
Referenced by BOOST_AUTO_TEST_CASE().
void http_func | ( | server * | s, |
websocketpp::connection_hdl | hdl | ||
) |
Definition at line 164 of file connection.cpp.
References websocketpp::endpoint< connection, config >::get_con_from_hdl(), websocketpp::close::status::get_string(), and websocketpp::http::status_code::ok.
Referenced by BOOST_AUTO_TEST_CASE().
void defer_http_func | ( | server * | s, |
bool * | deferred, | ||
websocketpp::connection_hdl | hdl | ||
) |
Definition at line 178 of file connection.cpp.
References websocketpp::endpoint< connection, config >::get_con_from_hdl().
Referenced by BOOST_AUTO_TEST_CASE().
void check_on_fail | ( | server * | s, |
websocketpp::lib::error_code | ec, | ||
bool & | called, | ||
websocketpp::connection_hdl | hdl | ||
) |
Definition at line 187 of file connection.cpp.
References websocketpp::endpoint< connection, config >::get_con_from_hdl().
Referenced by BOOST_AUTO_TEST_CASE().
void on_open_print | ( | server * | s, |
websocketpp::connection_hdl | hdl | ||
) |
Definition at line 196 of file connection.cpp.
References websocketpp::endpoint< connection, config >::get_con_from_hdl().
void fail_on_open | ( | websocketpp::connection_hdl | ) |
Definition at line 203 of file connection.cpp.
void fail_on_http | ( | websocketpp::connection_hdl | ) |
Definition at line 206 of file connection.cpp.
BOOST_AUTO_TEST_CASE | ( | connection_extensions | ) |
Definition at line 210 of file connection.cpp.
References connection_setup::c, and websocketpp::connection< config >::is_server().
BOOST_AUTO_TEST_CASE | ( | basic_websocket_request | ) |
Definition at line 219 of file connection.cpp.
References echo_func(), run_server_test(), websocketpp::endpoint< connection, config >::set_message_handler(), and websocketpp::user_agent.
BOOST_AUTO_TEST_CASE | ( | http_request | ) |
Definition at line 231 of file connection.cpp.
References http_func(), run_server_test(), websocketpp::endpoint< connection, config >::set_http_handler(), and websocketpp::user_agent.
BOOST_AUTO_TEST_CASE | ( | deferred_http_request | ) |
Definition at line 243 of file connection.cpp.
References websocketpp::log::elevel::all, websocketpp::log::alevel::all, websocketpp::endpoint< connection, config >::clear_access_channels(), websocketpp::endpoint< connection, config >::clear_error_channels(), defer_http_func(), websocketpp::session::http_state::deferred, websocketpp::server< config >::get_connection(), websocketpp::error::invalid_state, websocketpp::error::make_error_code(), websocketpp::http::status_code::ok, websocketpp::endpoint< connection, config >::send_http_response(), websocketpp::endpoint< connection, config >::set_http_handler(), and websocketpp::user_agent.
BOOST_AUTO_TEST_CASE | ( | request_no_server_header | ) |
Definition at line 281 of file connection.cpp.
References echo_func(), run_server_test(), websocketpp::endpoint< connection, config >::set_message_handler(), and websocketpp::endpoint< connection, config >::set_user_agent().
BOOST_AUTO_TEST_CASE | ( | request_no_server_header_override | ) |
Definition at line 292 of file connection.cpp.
References echo_func(), run_server_test(), websocketpp::endpoint< connection, config >::set_message_handler(), websocketpp::endpoint< connection, config >::set_user_agent(), websocketpp::endpoint< connection, config >::set_validate_handler(), and validate_set_ua().
BOOST_AUTO_TEST_CASE | ( | basic_client_websocket | ) |
Definition at line 304 of file connection.cpp.
References websocketpp::client< config >::connect(), websocketpp::client< config >::get_connection(), websocketpp::log::elevel::none, websocketpp::log::alevel::none, websocketpp::endpoint< connection, config >::set_access_channels(), websocketpp::endpoint< connection, config >::set_error_channels(), and websocketpp::endpoint< connection, config >::set_user_agent().
BOOST_AUTO_TEST_CASE | ( | set_max_message_size | ) |
Definition at line 328 of file connection.cpp.
References run_server_test(), websocketpp::endpoint< connection, config >::set_max_message_size(), websocketpp::endpoint< connection, config >::set_user_agent(), websocketpp::endpoint< connection, config >::set_validate_handler(), and validate_set_ua().
BOOST_AUTO_TEST_CASE | ( | websocket_fail_parse_error | ) |
Definition at line 351 of file connection.cpp.
References check_on_fail(), websocketpp::error::http_parse_error, websocketpp::error::make_error_code(), run_server_test(), and websocketpp::endpoint< connection, config >::set_fail_handler().
BOOST_AUTO_TEST_CASE | ( | websocket_fail_invalid_version | ) |
Definition at line 363 of file connection.cpp.
References check_on_fail(), websocketpp::error::invalid_version, websocketpp::error::make_error_code(), run_server_test(), and websocketpp::endpoint< connection, config >::set_fail_handler().
BOOST_AUTO_TEST_CASE | ( | websocket_fail_unsupported_version | ) |
Definition at line 375 of file connection.cpp.
References check_on_fail(), websocketpp::error::make_error_code(), run_server_test(), websocketpp::endpoint< connection, config >::set_fail_handler(), and websocketpp::error::unsupported_version.
BOOST_AUTO_TEST_CASE | ( | websocket_fail_upgrade_required | ) |
Definition at line 413 of file connection.cpp.
References check_on_fail(), websocketpp::error::make_error_code(), run_server_test(), websocketpp::endpoint< connection, config >::set_fail_handler(), and websocketpp::error::upgrade_required.
BOOST_AUTO_TEST_CASE | ( | client_handshake_timeout_race1 | ) |
Definition at line 454 of file connection.cpp.
References websocketpp::client< config >::connect(), websocketpp::client< config >::get_connection(), websocketpp::error::make_error_code(), and websocketpp::error::open_handshake_timeout.
BOOST_AUTO_TEST_CASE | ( | client_handshake_timeout_race2 | ) |
Definition at line 476 of file connection.cpp.
References websocketpp::client< config >::connect(), websocketpp::client< config >::get_connection(), websocketpp::error::make_error_code(), and websocketpp::error::open_handshake_timeout.
BOOST_AUTO_TEST_CASE | ( | server_handshake_timeout_race1 | ) |
Definition at line 501 of file connection.cpp.
References websocketpp::server< config >::get_connection(), websocketpp::error::make_error_code(), and websocketpp::error::open_handshake_timeout.
BOOST_AUTO_TEST_CASE | ( | server_handshake_timeout_race2 | ) |
Definition at line 516 of file connection.cpp.
References websocketpp::server< config >::get_connection(), websocketpp::error::make_error_code(), and websocketpp::error::open_handshake_timeout.