#include <boost/test/unit_test.hpp>
#include <websocketpp/error.hpp>
#include <websocketpp/extensions/extension.hpp>
#include <websocketpp/extensions/permessage_deflate/disabled.hpp>
#include <websocketpp/extensions/permessage_deflate/enabled.hpp>
#include <string>
#include <websocketpp/utilities.hpp>
#include <iostream>
Go to the source code of this file.
Classes | |
struct | config |
struct | ext_vars |
Macros | |
#define | BOOST_TEST_MODULE permessage_deflate |
Typedefs | |
typedef websocketpp::extensions::permessage_deflate::enabled< config > | enabled_type |
typedef websocketpp::extensions::permessage_deflate::disabled< config > | disabled_type |
Functions | |
BOOST_AUTO_TEST_CASE (disabled_is_disabled) | |
BOOST_AUTO_TEST_CASE (disabled_is_off) | |
BOOST_AUTO_TEST_CASE (enabled_is_enabled) | |
BOOST_AUTO_TEST_CASE (enabled_starts_disabled) | |
BOOST_AUTO_TEST_CASE (negotiation_empty_attr) | |
BOOST_AUTO_TEST_CASE (negotiation_invalid_attr) | |
BOOST_AUTO_TEST_CASE (negotiate_server_no_context_takeover_invalid) | |
BOOST_AUTO_TEST_CASE (negotiate_server_no_context_takeover) | |
BOOST_AUTO_TEST_CASE (negotiate_server_no_context_takeover_server_initiated) | |
BOOST_AUTO_TEST_CASE (negotiate_client_no_context_takeover_invalid) | |
BOOST_AUTO_TEST_CASE (negotiate_client_no_context_takeover) | |
BOOST_AUTO_TEST_CASE (negotiate_client_no_context_takeover_server_initiated) | |
BOOST_AUTO_TEST_CASE (negotiate_server_max_window_bits_invalid) | |
BOOST_AUTO_TEST_CASE (negotiate_server_max_window_bits_valid) | |
BOOST_AUTO_TEST_CASE (invalid_set_server_max_window_bits) | |
BOOST_AUTO_TEST_CASE (negotiate_server_max_window_bits_decline) | |
BOOST_AUTO_TEST_CASE (negotiate_server_max_window_bits_accept_8) | |
BOOST_AUTO_TEST_CASE (negotiate_server_max_window_bits_accept) | |
BOOST_AUTO_TEST_CASE (negotiate_server_max_window_bits_largest_8) | |
BOOST_AUTO_TEST_CASE (negotiate_server_max_window_bits_largest) | |
BOOST_AUTO_TEST_CASE (negotiate_server_max_window_bits_smallest_8) | |
BOOST_AUTO_TEST_CASE (negotiate_server_max_window_bits_smallest) | |
BOOST_AUTO_TEST_CASE (negotiate_client_max_window_bits_invalid) | |
BOOST_AUTO_TEST_CASE (negotiate_client_max_window_bits_valid) | |
BOOST_AUTO_TEST_CASE (invalid_set_client_max_window_bits) | |
BOOST_AUTO_TEST_CASE (negotiate_client_max_window_bits_decline_8) | |
BOOST_AUTO_TEST_CASE (negotiate_client_max_window_bits_decline) | |
BOOST_AUTO_TEST_CASE (negotiate_client_max_window_bits_accept_8) | |
BOOST_AUTO_TEST_CASE (negotiate_client_max_window_bits_accept) | |
BOOST_AUTO_TEST_CASE (negotiate_client_max_window_bits_largest_8) | |
BOOST_AUTO_TEST_CASE (negotiate_client_max_window_bits_largest) | |
BOOST_AUTO_TEST_CASE (negotiate_client_max_window_bits_smallest_8) | |
BOOST_AUTO_TEST_CASE (negotiate_client_max_window_bits_smallest) | |
BOOST_AUTO_TEST_CASE (negotiate_two_client_initiated1) | |
BOOST_AUTO_TEST_CASE (negotiate_two_client_initiated2) | |
BOOST_AUTO_TEST_CASE (negotiate_two_client_initiated3) | |
BOOST_AUTO_TEST_CASE (negotiate_two_client_initiated4) | |
BOOST_AUTO_TEST_CASE (negotiate_two_client_initiated5) | |
BOOST_AUTO_TEST_CASE (negotiate_two_client_initiated6) | |
BOOST_AUTO_TEST_CASE (negotiate_three_client_initiated1) | |
BOOST_AUTO_TEST_CASE (negotiate_three_client_initiated2) | |
BOOST_AUTO_TEST_CASE (negotiate_three_client_initiated3) | |
BOOST_AUTO_TEST_CASE (negotiate_three_client_initiated4) | |
BOOST_AUTO_TEST_CASE (negotiate_four_client_initiated) | |
BOOST_AUTO_TEST_CASE (compress_data) | |
BOOST_AUTO_TEST_CASE (compress_data_multiple) | |
BOOST_AUTO_TEST_CASE (compress_data_large) | |
BOOST_AUTO_TEST_CASE (compress_data_no_context_takeover) | |
BOOST_AUTO_TEST_CASE (compress_empty) | |
BOOST_AUTO_TEST_CASE (decompress_data) | |
#define BOOST_TEST_MODULE permessage_deflate |
Definition at line 28 of file permessage_deflate.cpp.
Definition at line 44 of file permessage_deflate.cpp.
Definition at line 45 of file permessage_deflate.cpp.
BOOST_AUTO_TEST_CASE | ( | disabled_is_disabled | ) |
Definition at line 59 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::disabled< config >::is_implemented().
BOOST_AUTO_TEST_CASE | ( | disabled_is_off | ) |
Definition at line 64 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::disabled< config >::is_enabled().
BOOST_AUTO_TEST_CASE | ( | enabled_is_enabled | ) |
Definition at line 71 of file permessage_deflate.cpp.
References ext_vars::extc, ext_vars::exts, and websocketpp::extensions::permessage_deflate::enabled< config >::is_implemented().
BOOST_AUTO_TEST_CASE | ( | enabled_starts_disabled | ) |
Definition at line 78 of file permessage_deflate.cpp.
References ext_vars::extc, ext_vars::exts, and websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled().
BOOST_AUTO_TEST_CASE | ( | negotiation_empty_attr | ) |
Definition at line 84 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), and websocketpp::extensions::permessage_deflate::enabled< config >::negotiate().
BOOST_AUTO_TEST_CASE | ( | negotiation_invalid_attr | ) |
Definition at line 93 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::error::invalid_attributes, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::error::make_error_code(), and websocketpp::extensions::permessage_deflate::enabled< config >::negotiate().
BOOST_AUTO_TEST_CASE | ( | negotiate_server_no_context_takeover_invalid | ) |
Definition at line 104 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::error::invalid_attribute_value, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::error::make_error_code(), and websocketpp::extensions::permessage_deflate::enabled< config >::negotiate().
BOOST_AUTO_TEST_CASE | ( | negotiate_server_no_context_takeover | ) |
BOOST_AUTO_TEST_CASE | ( | negotiate_server_no_context_takeover_server_initiated | ) |
Definition at line 124 of file permessage_deflate.cpp.
References ext_vars::attr, websocketpp::extensions::permessage_deflate::enabled< config >::enable_server_no_context_takeover(), ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), and websocketpp::extensions::permessage_deflate::enabled< config >::negotiate().
BOOST_AUTO_TEST_CASE | ( | negotiate_client_no_context_takeover_invalid | ) |
Definition at line 135 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::error::invalid_attribute_value, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::error::make_error_code(), and websocketpp::extensions::permessage_deflate::enabled< config >::negotiate().
BOOST_AUTO_TEST_CASE | ( | negotiate_client_no_context_takeover | ) |
BOOST_AUTO_TEST_CASE | ( | negotiate_client_no_context_takeover_server_initiated | ) |
Definition at line 155 of file permessage_deflate.cpp.
References ext_vars::attr, websocketpp::extensions::permessage_deflate::enabled< config >::enable_client_no_context_takeover(), ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), and websocketpp::extensions::permessage_deflate::enabled< config >::negotiate().
BOOST_AUTO_TEST_CASE | ( | negotiate_server_max_window_bits_invalid | ) |
Definition at line 167 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::error::invalid_attribute_value, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::error::make_error_code(), and websocketpp::extensions::permessage_deflate::enabled< config >::negotiate().
BOOST_AUTO_TEST_CASE | ( | negotiate_server_max_window_bits_valid | ) |
BOOST_AUTO_TEST_CASE | ( | invalid_set_server_max_window_bits | ) |
Definition at line 211 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::mode::decline, ext_vars::ec, ext_vars::exts, websocketpp::extensions::permessage_deflate::error::invalid_max_window_bits, websocketpp::error::make_error_code(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_server_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_server_max_window_bits_decline | ) |
Definition at line 221 of file permessage_deflate.cpp.
References ext_vars::attr, websocketpp::extensions::permessage_deflate::mode::decline, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_server_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_server_max_window_bits_accept_8 | ) |
Definition at line 233 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::mode::accept, ext_vars::attr, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_server_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_server_max_window_bits_accept | ) |
Definition at line 245 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::mode::accept, ext_vars::attr, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_server_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_server_max_window_bits_largest_8 | ) |
Definition at line 257 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::mode::largest, websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_server_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_server_max_window_bits_largest | ) |
Definition at line 269 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::mode::largest, websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_server_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_server_max_window_bits_smallest_8 | ) |
Definition at line 281 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), websocketpp::extensions::permessage_deflate::enabled< config >::set_server_max_window_bits(), and websocketpp::extensions::permessage_deflate::mode::smallest.
BOOST_AUTO_TEST_CASE | ( | negotiate_server_max_window_bits_smallest | ) |
Definition at line 293 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), websocketpp::extensions::permessage_deflate::enabled< config >::set_server_max_window_bits(), and websocketpp::extensions::permessage_deflate::mode::smallest.
BOOST_AUTO_TEST_CASE | ( | negotiate_client_max_window_bits_invalid | ) |
Definition at line 306 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::error::invalid_attribute_value, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::error::make_error_code(), and websocketpp::extensions::permessage_deflate::enabled< config >::negotiate().
BOOST_AUTO_TEST_CASE | ( | negotiate_client_max_window_bits_valid | ) |
BOOST_AUTO_TEST_CASE | ( | invalid_set_client_max_window_bits | ) |
Definition at line 353 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::mode::decline, ext_vars::ec, ext_vars::exts, websocketpp::extensions::permessage_deflate::error::invalid_max_window_bits, websocketpp::error::make_error_code(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_client_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_client_max_window_bits_decline_8 | ) |
Definition at line 363 of file permessage_deflate.cpp.
References ext_vars::attr, websocketpp::extensions::permessage_deflate::mode::decline, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_client_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_client_max_window_bits_decline | ) |
Definition at line 375 of file permessage_deflate.cpp.
References ext_vars::attr, websocketpp::extensions::permessage_deflate::mode::decline, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_client_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_client_max_window_bits_accept_8 | ) |
Definition at line 387 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::mode::accept, ext_vars::attr, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_client_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_client_max_window_bits_accept | ) |
Definition at line 399 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::mode::accept, ext_vars::attr, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_client_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_client_max_window_bits_largest_8 | ) |
Definition at line 411 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::mode::largest, websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_client_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_client_max_window_bits_largest | ) |
Definition at line 423 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::mode::largest, websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), and websocketpp::extensions::permessage_deflate::enabled< config >::set_client_max_window_bits().
BOOST_AUTO_TEST_CASE | ( | negotiate_client_max_window_bits_smallest_8 | ) |
Definition at line 435 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), websocketpp::extensions::permessage_deflate::enabled< config >::set_client_max_window_bits(), and websocketpp::extensions::permessage_deflate::mode::smallest.
BOOST_AUTO_TEST_CASE | ( | negotiate_client_max_window_bits_smallest | ) |
Definition at line 447 of file permessage_deflate.cpp.
References ext_vars::attr, ext_vars::ec, ext_vars::esp, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::is_enabled(), websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), websocketpp::extensions::permessage_deflate::enabled< config >::set_client_max_window_bits(), and websocketpp::extensions::permessage_deflate::mode::smallest.
BOOST_AUTO_TEST_CASE | ( | negotiate_two_client_initiated1 | ) |
BOOST_AUTO_TEST_CASE | ( | negotiate_two_client_initiated2 | ) |
BOOST_AUTO_TEST_CASE | ( | negotiate_two_client_initiated3 | ) |
BOOST_AUTO_TEST_CASE | ( | negotiate_two_client_initiated4 | ) |
BOOST_AUTO_TEST_CASE | ( | negotiate_two_client_initiated5 | ) |
BOOST_AUTO_TEST_CASE | ( | negotiate_two_client_initiated6 | ) |
BOOST_AUTO_TEST_CASE | ( | negotiate_three_client_initiated1 | ) |
BOOST_AUTO_TEST_CASE | ( | negotiate_three_client_initiated2 | ) |
BOOST_AUTO_TEST_CASE | ( | negotiate_three_client_initiated3 | ) |
BOOST_AUTO_TEST_CASE | ( | negotiate_three_client_initiated4 | ) |
BOOST_AUTO_TEST_CASE | ( | negotiate_four_client_initiated | ) |
BOOST_AUTO_TEST_CASE | ( | compress_data | ) |
Definition at line 600 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::enabled< config >::compress(), websocketpp::extensions::permessage_deflate::enabled< config >::decompress(), ext_vars::ec, ext_vars::exts, and websocketpp::extensions::permessage_deflate::enabled< config >::init().
BOOST_AUTO_TEST_CASE | ( | compress_data_multiple | ) |
Definition at line 618 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::enabled< config >::compress(), websocketpp::extensions::permessage_deflate::enabled< config >::decompress(), ext_vars::ec, ext_vars::exts, and websocketpp::extensions::permessage_deflate::enabled< config >::init().
BOOST_AUTO_TEST_CASE | ( | compress_data_large | ) |
Definition at line 638 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::enabled< config >::compress(), websocketpp::extensions::permessage_deflate::enabled< config >::decompress(), ext_vars::ec, ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::init(), websocketpp::extensions::permessage_deflate::enabled< config >::negotiate(), websocketpp::extensions::permessage_deflate::enabled< config >::set_server_max_window_bits(), and websocketpp::extensions::permessage_deflate::mode::smallest.
BOOST_AUTO_TEST_CASE | ( | compress_data_no_context_takeover | ) |
Definition at line 662 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::enabled< config >::compress(), websocketpp::extensions::permessage_deflate::enabled< config >::decompress(), ext_vars::ec, websocketpp::extensions::permessage_deflate::enabled< config >::enable_server_no_context_takeover(), ext_vars::exts, websocketpp::extensions::permessage_deflate::enabled< config >::init(), and websocketpp::extensions::permessage_deflate::enabled< config >::negotiate().
BOOST_AUTO_TEST_CASE | ( | compress_empty | ) |
Definition at line 706 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::enabled< config >::compress(), websocketpp::extensions::permessage_deflate::enabled< config >::decompress(), ext_vars::ec, ext_vars::exts, and websocketpp::extensions::permessage_deflate::enabled< config >::init().
BOOST_AUTO_TEST_CASE | ( | decompress_data | ) |
- compress at different compression levels
Definition at line 738 of file permessage_deflate.cpp.
References websocketpp::extensions::permessage_deflate::enabled< config >::decompress(), ext_vars::ec, ext_vars::exts, and websocketpp::extensions::permessage_deflate::enabled< config >::init().