#include <boost/test/unit_test.hpp>
#include <iostream>
#include <string>
#include <websocketpp/http/request.hpp>
#include <websocketpp/http/response.hpp>
Go to the source code of this file.
Macros | |
#define | BOOST_TEST_MODULE http_parser |
Functions | |
BOOST_AUTO_TEST_CASE (is_token_char) | |
BOOST_AUTO_TEST_CASE (extract_token) | |
BOOST_AUTO_TEST_CASE (extract_quoted_string) | |
BOOST_AUTO_TEST_CASE (extract_all_lws) | |
BOOST_AUTO_TEST_CASE (extract_attributes_blank) | |
BOOST_AUTO_TEST_CASE (extract_attributes_simple) | |
BOOST_AUTO_TEST_CASE (extract_parameters) | |
BOOST_AUTO_TEST_CASE (strip_lws) | |
BOOST_AUTO_TEST_CASE (case_insensitive_headers) | |
BOOST_AUTO_TEST_CASE (case_insensitive_headers_overwrite) | |
BOOST_AUTO_TEST_CASE (blank_consume) | |
BOOST_AUTO_TEST_CASE (blank_request) | |
BOOST_AUTO_TEST_CASE (bad_request_no_host) | |
BOOST_AUTO_TEST_CASE (basic_request) | |
BOOST_AUTO_TEST_CASE (basic_request_with_body) | |
BOOST_AUTO_TEST_CASE (basic_request_with_body_split) | |
BOOST_AUTO_TEST_CASE (trailing_body_characters) | |
BOOST_AUTO_TEST_CASE (trailing_body_characters_beyond_max_lenth) | |
BOOST_AUTO_TEST_CASE (basic_split1) | |
BOOST_AUTO_TEST_CASE (basic_split2) | |
BOOST_AUTO_TEST_CASE (max_header_len) | |
BOOST_AUTO_TEST_CASE (max_header_len_split) | |
BOOST_AUTO_TEST_CASE (max_body_len) | |
BOOST_AUTO_TEST_CASE (firefox_full_request) | |
BOOST_AUTO_TEST_CASE (bad_method) | |
BOOST_AUTO_TEST_CASE (bad_header_name) | |
BOOST_AUTO_TEST_CASE (old_http_version) | |
BOOST_AUTO_TEST_CASE (new_http_version1) | |
BOOST_AUTO_TEST_CASE (new_http_version2) | |
BOOST_AUTO_TEST_CASE (header_whitespace1) | |
BOOST_AUTO_TEST_CASE (header_whitespace2) | |
BOOST_AUTO_TEST_CASE (header_aggregation) | |
BOOST_AUTO_TEST_CASE (wikipedia_example_response) | |
BOOST_AUTO_TEST_CASE (wikipedia_example_response_trailing) | |
BOOST_AUTO_TEST_CASE (wikipedia_example_response_trailing_large) | |
BOOST_AUTO_TEST_CASE (response_with_non_standard_lws) | |
BOOST_AUTO_TEST_CASE (plain_http_response) | |
BOOST_AUTO_TEST_CASE (parse_istream) | |
BOOST_AUTO_TEST_CASE (write_request_basic) | |
BOOST_AUTO_TEST_CASE (write_request_with_header) | |
BOOST_AUTO_TEST_CASE (write_request_with_body) | |
#define BOOST_TEST_MODULE http_parser |
Definition at line 28 of file parser.cpp.
BOOST_AUTO_TEST_CASE | ( | is_token_char | ) |
Definition at line 37 of file parser.cpp.
References websocketpp::http::is_not_token_char(), and websocketpp::http::is_token_char().
BOOST_AUTO_TEST_CASE | ( | extract_token | ) |
Definition at line 107 of file parser.cpp.
References websocketpp::http::parser::extract_token().
BOOST_AUTO_TEST_CASE | ( | extract_quoted_string | ) |
Definition at line 126 of file parser.cpp.
References websocketpp::http::parser::extract_quoted_string().
BOOST_AUTO_TEST_CASE | ( | extract_all_lws | ) |
Definition at line 158 of file parser.cpp.
References websocketpp::http::parser::extract_all_lws().
BOOST_AUTO_TEST_CASE | ( | extract_attributes_blank | ) |
Definition at line 187 of file parser.cpp.
References websocketpp::http::parser::extract_attributes().
BOOST_AUTO_TEST_CASE | ( | extract_attributes_simple | ) |
Definition at line 198 of file parser.cpp.
References websocketpp::http::parser::extract_attributes().
BOOST_AUTO_TEST_CASE | ( | extract_parameters | ) |
Definition at line 211 of file parser.cpp.
References websocketpp::http::parser::extract_parameters().
BOOST_AUTO_TEST_CASE | ( | strip_lws | ) |
Definition at line 359 of file parser.cpp.
References websocketpp::http::parser::strip_lws().
BOOST_AUTO_TEST_CASE | ( | case_insensitive_headers | ) |
Definition at line 381 of file parser.cpp.
References websocketpp::http::parser::parser::get_header(), and websocketpp::http::parser::parser::replace_header().
BOOST_AUTO_TEST_CASE | ( | case_insensitive_headers_overwrite | ) |
Definition at line 391 of file parser.cpp.
References websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::parser::remove_header(), and websocketpp::http::parser::parser::replace_header().
BOOST_AUTO_TEST_CASE | ( | blank_consume | ) |
Definition at line 410 of file parser.cpp.
References websocketpp::http::parser::request::consume(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | blank_request | ) |
Definition at line 427 of file parser.cpp.
References websocketpp::http::parser::request::consume(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | bad_request_no_host | ) |
Definition at line 444 of file parser.cpp.
References websocketpp::http::parser::request::consume(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | basic_request | ) |
Definition at line 461 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | basic_request_with_body | ) |
Definition at line 485 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_body(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | basic_request_with_body_split | ) |
Definition at line 511 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_body(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | trailing_body_characters | ) |
Definition at line 541 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | trailing_body_characters_beyond_max_lenth | ) |
Definition at line 564 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), websocketpp::http::max_header_size, and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | basic_split1 | ) |
Definition at line 588 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | basic_split2 | ) |
Definition at line 614 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | max_header_len | ) |
Definition at line 640 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::exception::m_error_code, websocketpp::http::max_header_size, and websocketpp::http::status_code::request_header_fields_too_large.
BOOST_AUTO_TEST_CASE | ( | max_header_len_split | ) |
Definition at line 660 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::exception::m_error_code, websocketpp::http::max_header_size, and websocketpp::http::status_code::request_header_fields_too_large.
BOOST_AUTO_TEST_CASE | ( | max_body_len | ) |
Definition at line 681 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_max_body_size(), websocketpp::http::exception::m_error_code, websocketpp::http::status_code::request_entity_too_large, and websocketpp::http::parser::parser::set_max_body_size().
BOOST_AUTO_TEST_CASE | ( | firefox_full_request | ) |
Definition at line 702 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | bad_method | ) |
Definition at line 736 of file parser.cpp.
References websocketpp::http::parser::request::consume().
BOOST_AUTO_TEST_CASE | ( | bad_header_name | ) |
Definition at line 752 of file parser.cpp.
References websocketpp::http::parser::request::consume().
BOOST_AUTO_TEST_CASE | ( | old_http_version | ) |
Definition at line 768 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | new_http_version1 | ) |
Definition at line 791 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | new_http_version2 | ) |
Definition at line 814 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | header_whitespace1 | ) |
Definition at line 856 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | header_whitespace2 | ) |
Definition at line 879 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | header_aggregation | ) |
Definition at line 902 of file parser.cpp.
References websocketpp::http::parser::request::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::request::get_method(), websocketpp::http::parser::request::get_uri(), websocketpp::http::parser::parser::get_version(), and websocketpp::http::parser::request::ready().
BOOST_AUTO_TEST_CASE | ( | wikipedia_example_response | ) |
Definition at line 925 of file parser.cpp.
References websocketpp::http::parser::response::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::response::get_status_code(), websocketpp::http::parser::response::get_status_msg(), websocketpp::http::parser::parser::get_version(), websocketpp::http::parser::response::headers_ready(), and websocketpp::http::status_code::switching_protocols.
BOOST_AUTO_TEST_CASE | ( | wikipedia_example_response_trailing | ) |
Definition at line 952 of file parser.cpp.
References websocketpp::http::parser::response::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::response::get_status_code(), websocketpp::http::parser::response::get_status_msg(), websocketpp::http::parser::parser::get_version(), websocketpp::http::parser::response::headers_ready(), and websocketpp::http::status_code::switching_protocols.
BOOST_AUTO_TEST_CASE | ( | wikipedia_example_response_trailing_large | ) |
Definition at line 980 of file parser.cpp.
References websocketpp::http::parser::response::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::response::get_status_code(), websocketpp::http::parser::response::get_status_msg(), websocketpp::http::parser::parser::get_version(), websocketpp::http::parser::response::headers_ready(), websocketpp::http::max_header_size, and websocketpp::http::status_code::switching_protocols.
BOOST_AUTO_TEST_CASE | ( | response_with_non_standard_lws | ) |
Definition at line 1008 of file parser.cpp.
References websocketpp::http::parser::response::consume(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::response::get_status_code(), websocketpp::http::parser::response::get_status_msg(), websocketpp::http::parser::parser::get_version(), websocketpp::http::parser::response::headers_ready(), and websocketpp::http::status_code::switching_protocols.
BOOST_AUTO_TEST_CASE | ( | plain_http_response | ) |
Definition at line 1035 of file parser.cpp.
References websocketpp::http::parser::response::consume(), websocketpp::http::parser::parser::get_body(), websocketpp::http::parser::parser::get_header(), websocketpp::http::parser::response::get_status_code(), websocketpp::http::parser::response::get_status_msg(), websocketpp::http::parser::parser::get_version(), websocketpp::http::parser::response::headers_ready(), websocketpp::http::status_code::ok, and websocketpp::http::parser::response::ready().
BOOST_AUTO_TEST_CASE | ( | parse_istream | ) |
Definition at line 1068 of file parser.cpp.
References websocketpp::http::parser::response::consume(), websocketpp::http::parser::response::headers_ready(), and websocketpp::http::parser::response::ready().
BOOST_AUTO_TEST_CASE | ( | write_request_basic | ) |
Definition at line 1091 of file parser.cpp.
References websocketpp::http::parser::request::raw(), websocketpp::http::parser::request::set_method(), websocketpp::http::parser::request::set_uri(), and websocketpp::http::parser::parser::set_version().
BOOST_AUTO_TEST_CASE | ( | write_request_with_header | ) |
Definition at line 1103 of file parser.cpp.
References websocketpp::http::parser::request::raw(), websocketpp::http::parser::parser::replace_header(), websocketpp::http::parser::request::set_method(), websocketpp::http::parser::request::set_uri(), and websocketpp::http::parser::parser::set_version().
BOOST_AUTO_TEST_CASE | ( | write_request_with_body | ) |
Definition at line 1116 of file parser.cpp.
References websocketpp::http::parser::request::raw(), websocketpp::http::parser::parser::replace_header(), websocketpp::http::parser::parser::set_body(), websocketpp::http::parser::request::set_method(), websocketpp::http::parser::request::set_uri(), and websocketpp::http::parser::parser::set_version().