adds more client functionality and associated tests

This commit is contained in:
Peter Thorson
2013-03-28 22:58:54 -05:00
parent 0b0106a97f
commit afd5646ca5
3 changed files with 44 additions and 17 deletions

View File

@@ -56,7 +56,7 @@ struct stub_config : public websocketpp::config::core {
typedef websocketpp::client<stub_config> client;
typedef client::connection_ptr connection_ptr;
BOOST_AUTO_TEST_CASE( get_connection ) {
BOOST_AUTO_TEST_CASE( invalid_uri ) {
client c;
websocketpp::lib::error_code ec;
@@ -64,3 +64,21 @@ BOOST_AUTO_TEST_CASE( get_connection ) {
BOOST_CHECK( ec == websocketpp::error::make_error_code(websocketpp::error::invalid_uri) );
}
BOOST_AUTO_TEST_CASE( unsecure_endpoint ) {
client c;
websocketpp::lib::error_code ec;
connection_ptr con = c.get_connection("wss://localhost/", ec);
BOOST_CHECK( ec == websocketpp::error::make_error_code(websocketpp::error::endpoint_not_secure) );
}
BOOST_AUTO_TEST_CASE( get_connection ) {
client c;
websocketpp::lib::error_code ec;
connection_ptr con = c.get_connection("ws://localhost/", ec);
BOOST_CHECK( con );
}