Skip to content

Commit ffaeba2

Browse files
author
Peter Thorson
committed
switch comment style in connection tests
1 parent db304bf commit ffaeba2

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

test/connection/connection.cpp

+34-34
Original file line numberDiff line numberDiff line change
@@ -381,31 +381,31 @@ BOOST_AUTO_TEST_CASE( websocket_fail_unsupported_version ) {
381381
BOOST_CHECK(called);
382382
}
383383

384-
/*BOOST_AUTO_TEST_CASE( websocket_fail_invalid_uri ) {
385-
std::string input = "GET http://345.123.123.123/foo HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 13\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nOrigin: http://www.example.com\r\n\r\n";
384+
// BOOST_AUTO_TEST_CASE( websocket_fail_invalid_uri ) {
385+
// std::string input = "GET http://345.123.123.123/foo HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 13\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nOrigin: http://www.example.com\r\n\r\n";
386386

387-
server s;
388-
websocketpp::lib::error_code ec = make_error_code(websocketpp::error::unsupported_version);
389-
bool called = false;
390-
s.set_fail_handler(bind(&check_on_fail,&s,ec,websocketpp::lib::ref(called),::_1));
391-
s.set_open_handler(bind(&on_open_print,&s,::_1));
387+
// server s;
388+
// websocketpp::lib::error_code ec = make_error_code(websocketpp::error::unsupported_version);
389+
// bool called = false;
390+
// s.set_fail_handler(bind(&check_on_fail,&s,ec,websocketpp::lib::ref(called),::_1));
391+
// s.set_open_handler(bind(&on_open_print,&s,::_1));
392392

393-
std::cout << run_server_test(s,input,true) << std::endl;
394-
BOOST_CHECK(called);
395-
}
393+
// std::cout << run_server_test(s,input,true) << std::endl;
394+
// BOOST_CHECK(called);
395+
// }
396396

397-
BOOST_AUTO_TEST_CASE( websocket_fail_invalid_uri_http ) {
398-
std::string input = "GET http://345.123.123.123/foo HTTP/1.1\r\nHost: www.example.com\r\nOrigin: http://www.example.com\r\n\r\n";
397+
// BOOST_AUTO_TEST_CASE( websocket_fail_invalid_uri_http ) {
398+
// std::string input = "GET http://345.123.123.123/foo HTTP/1.1\r\nHost: www.example.com\r\nOrigin: http://www.example.com\r\n\r\n";
399399

400-
server s;
401-
websocketpp::lib::error_code ec = make_error_code(websocketpp::error::unsupported_version);
402-
bool called = false;
403-
s.set_fail_handler(bind(&check_on_fail,&s,ec,websocketpp::lib::ref(called),::_1));
404-
s.set_open_handler(bind(&on_open_print,&s,::_1));
400+
// server s;
401+
// websocketpp::lib::error_code ec = make_error_code(websocketpp::error::unsupported_version);
402+
// bool called = false;
403+
// s.set_fail_handler(bind(&check_on_fail,&s,ec,websocketpp::lib::ref(called),::_1));
404+
// s.set_open_handler(bind(&on_open_print,&s,::_1));
405405

406-
std::cout << run_server_test(s,input,true) << std::endl;
407-
BOOST_CHECK(called);
408-
}*/
406+
// std::cout << run_server_test(s,input,true) << std::endl;
407+
// BOOST_CHECK(called);
408+
// }
409409

410410
BOOST_AUTO_TEST_CASE( websocket_fail_upgrade_required ) {
411411
std::string input = "GET /foo/bar HTTP/1.1\r\nHost: www.example.com\r\nOrigin: http://www.example.com\r\n\r\n";
@@ -423,26 +423,26 @@ BOOST_AUTO_TEST_CASE( websocket_fail_upgrade_required ) {
423423
// TODO: set max message size mid connection test case
424424
// TODO: [maybe] set max message size in open handler
425425

426-
/*
427426

428-
BOOST_AUTO_TEST_CASE( user_reject_origin ) {
429-
std::string input = "GET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 13\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nOrigin: http://www.example2.com\r\n\r\n";
430-
std::string output = "HTTP/1.1 403 Forbidden\r\nServer: "+websocketpp::USER_AGENT+"\r\n\r\n";
431427

432-
BOOST_CHECK(run_server_test(input) == output);
433-
}
428+
// BOOST_AUTO_TEST_CASE( user_reject_origin ) {
429+
// std::string input = "GET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 13\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nOrigin: http://www.example2.com\r\n\r\n";
430+
// std::string output = "HTTP/1.1 403 Forbidden\r\nServer: "+websocketpp::USER_AGENT+"\r\n\r\n";
434431

435-
BOOST_AUTO_TEST_CASE( basic_text_message ) {
436-
std::string input = "GET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 13\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nOrigin: http://www.example.com\r\n\r\n";
432+
// BOOST_CHECK(run_server_test(input) == output);
433+
// }
437434

438-
unsigned char frames[8] = {0x82,0x82,0xFF,0xFF,0xFF,0xFF,0xD5,0xD5};
439-
input.append(reinterpret_cast<char*>(frames),8);
435+
// BOOST_AUTO_TEST_CASE( basic_text_message ) {
436+
// std::string input = "GET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 13\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nOrigin: http://www.example.com\r\n\r\n";
440437

441-
std::string output = "HTTP/1.1 101 Switching Protocols\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\nServer: "+websocketpp::USER_AGENT+"\r\nUpgrade: websocket\r\n\r\n**";
438+
// unsigned char frames[8] = {0x82,0x82,0xFF,0xFF,0xFF,0xFF,0xD5,0xD5};
439+
// input.append(reinterpret_cast<char*>(frames),8);
440+
441+
// std::string output = "HTTP/1.1 101 Switching Protocols\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\nServer: "+websocketpp::USER_AGENT+"\r\nUpgrade: websocket\r\n\r\n**";
442+
443+
// BOOST_CHECK( run_server_test(input) == output);
444+
// }
442445

443-
BOOST_CHECK( run_server_test(input) == output);
444-
}
445-
*/
446446

447447

448448

0 commit comments

Comments
 (0)