client get_connection now sets URI

This commit is contained in:
Peter Thorson
2013-03-30 07:05:31 -05:00
parent 7afcd866a0
commit 1ddd43ccb0
2 changed files with 9 additions and 3 deletions

View File

@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE( invalid_uri ) {
connection_ptr con = c.get_connection("foo", ec);
BOOST_CHECK( ec == websocketpp::error::make_error_code(websocketpp::error::invalid_uri) );
BOOST_CHECK_EQUAL( ec , websocketpp::error::make_error_code(websocketpp::error::invalid_uri) );
}
BOOST_AUTO_TEST_CASE( unsecure_endpoint ) {
@@ -71,7 +71,7 @@ BOOST_AUTO_TEST_CASE( unsecure_endpoint ) {
connection_ptr con = c.get_connection("wss://localhost/", ec);
BOOST_CHECK( ec == websocketpp::error::make_error_code(websocketpp::error::endpoint_not_secure) );
BOOST_CHECK_EQUAL( ec , websocketpp::error::make_error_code(websocketpp::error::endpoint_not_secure) );
}
BOOST_AUTO_TEST_CASE( get_connection ) {
@@ -81,4 +81,8 @@ BOOST_AUTO_TEST_CASE( get_connection ) {
connection_ptr con = c.get_connection("ws://localhost/", ec);
BOOST_CHECK( con );
}
BOOST_CHECK_EQUAL( con->get_host() , "localhost" );
BOOST_CHECK_EQUAL( con->get_port() , 80 );
BOOST_CHECK_EQUAL( con->get_secure() , false );
BOOST_CHECK_EQUAL( con->get_resource() , "/" );
}

View File

@@ -98,6 +98,8 @@ public:
return con;
}
con->set_uri(location);
// Success
ec = lib::error_code();
return con;