#include <boost/test/unit_test.hpp>#include <iostream>#include <websocketpp/config/core.hpp>#include <websocketpp/server.hpp>
Go to the source code of this file.
Macros | |
| #define | BOOST_TEST_MODULE server | 
Typedefs | |
| typedef websocketpp::server< websocketpp::config::core > | server | 
| typedef websocketpp::config::core::message_type::ptr | message_ptr | 
Functions | |
| std::string | run_server_test (server &s, std::string input) | 
| void | echo_func (server *s, websocketpp::connection_hdl hdl, message_ptr msg) | 
| bool | validate_func_subprotocol (server *s, std::string *out, std::string accept, websocketpp::connection_hdl hdl) | 
| void | open_func_subprotocol (server *s, std::string *out, websocketpp::connection_hdl hdl) | 
| BOOST_AUTO_TEST_CASE (basic_websocket_request) | |
| BOOST_AUTO_TEST_CASE (invalid_websocket_version) | |
| BOOST_AUTO_TEST_CASE (unimplemented_websocket_version) | |
| BOOST_AUTO_TEST_CASE (list_subprotocol_empty) | |
| BOOST_AUTO_TEST_CASE (list_subprotocol_one) | |
| BOOST_AUTO_TEST_CASE (accept_subprotocol_one) | |
| BOOST_AUTO_TEST_CASE (accept_subprotocol_invalid) | |
| BOOST_AUTO_TEST_CASE (accept_subprotocol_two) | |
| #define BOOST_TEST_MODULE server | 
Definition at line 28 of file server.cpp.
Definition at line 38 of file server.cpp.
Definition at line 39 of file server.cpp.
| std::string run_server_test | ( | server & | s, | 
| std::string | input | ||
| ) | 
Definition at line 66 of file server.cpp.
References websocketpp::log::elevel::all, websocketpp::log::alevel::all, websocketpp::endpoint< connection, config >::clear_access_channels(), websocketpp::endpoint< connection, config >::clear_error_channels(), and websocketpp::server< config >::get_connection().
Referenced by BOOST_AUTO_TEST_CASE().
| void echo_func | ( | server * | s, | 
| websocketpp::connection_hdl | hdl, | ||
| message_ptr | msg | ||
| ) | 
Definition at line 86 of file server.cpp.
References websocketpp::endpoint< connection, config >::send().
| bool validate_func_subprotocol | ( | server * | s, | 
| std::string * | out, | ||
| std::string | accept, | ||
| websocketpp::connection_hdl | hdl | ||
| ) | 
Definition at line 90 of file server.cpp.
References websocketpp::endpoint< connection, config >::get_con_from_hdl().
Referenced by BOOST_AUTO_TEST_CASE().
| void open_func_subprotocol | ( | server * | s, | 
| std::string * | out, | ||
| websocketpp::connection_hdl | hdl | ||
| ) | 
Definition at line 113 of file server.cpp.
References websocketpp::endpoint< connection, config >::get_con_from_hdl().
Referenced by BOOST_AUTO_TEST_CASE().
| BOOST_AUTO_TEST_CASE | ( | basic_websocket_request | ) | 
Definition at line 120 of file server.cpp.
References run_server_test(), and websocketpp::endpoint< connection, config >::set_user_agent().
| BOOST_AUTO_TEST_CASE | ( | invalid_websocket_version | ) | 
Definition at line 130 of file server.cpp.
References run_server_test(), and websocketpp::endpoint< connection, config >::set_user_agent().
| BOOST_AUTO_TEST_CASE | ( | unimplemented_websocket_version | ) | 
Definition at line 141 of file server.cpp.
References run_server_test(), and websocketpp::endpoint< connection, config >::set_user_agent().
| BOOST_AUTO_TEST_CASE | ( | list_subprotocol_empty | ) | 
Definition at line 152 of file server.cpp.
References open_func_subprotocol(), run_server_test(), websocketpp::endpoint< connection, config >::set_open_handler(), and websocketpp::endpoint< connection, config >::set_user_agent().
| BOOST_AUTO_TEST_CASE | ( | list_subprotocol_one | ) | 
Definition at line 167 of file server.cpp.
References websocketpp::session::state::open, open_func_subprotocol(), run_server_test(), websocketpp::endpoint< connection, config >::set_open_handler(), websocketpp::endpoint< connection, config >::set_user_agent(), websocketpp::endpoint< connection, config >::set_validate_handler(), validate(), and validate_func_subprotocol().
| BOOST_AUTO_TEST_CASE | ( | accept_subprotocol_one | ) | 
Definition at line 185 of file server.cpp.
References websocketpp::session::state::open, open_func_subprotocol(), run_server_test(), websocketpp::endpoint< connection, config >::set_open_handler(), websocketpp::endpoint< connection, config >::set_user_agent(), websocketpp::endpoint< connection, config >::set_validate_handler(), validate(), and validate_func_subprotocol().
| BOOST_AUTO_TEST_CASE | ( | accept_subprotocol_invalid | ) | 
Definition at line 203 of file server.cpp.
References websocketpp::session::state::open, open_func_subprotocol(), run_server_test(), websocketpp::endpoint< connection, config >::set_open_handler(), websocketpp::endpoint< connection, config >::set_user_agent(), websocketpp::endpoint< connection, config >::set_validate_handler(), validate(), and validate_func_subprotocol().
| BOOST_AUTO_TEST_CASE | ( | accept_subprotocol_two | ) | 
Definition at line 221 of file server.cpp.
References websocketpp::session::state::open, open_func_subprotocol(), run_server_test(), websocketpp::endpoint< connection, config >::set_open_handler(), websocketpp::endpoint< connection, config >::set_user_agent(), websocketpp::endpoint< connection, config >::set_validate_handler(), validate(), and validate_func_subprotocol().