diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fa3b0ec..2932d7f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 60: + +* String comparisons are public interfaces + +-------------------------------------------------------------------------------- + Version 59: * Integrated Beast INTERFACE (cmake) diff --git a/doc/quickref.xml b/doc/quickref.xml index 04edf9d5..3216d575 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -142,10 +142,10 @@ - + Core - + ZLib @@ -169,10 +169,17 @@ error_category error_code error_condition + + + +   + flat_buffer handler_alloc handler_ptr handler_type + iequal + iless multi_buffer static_buffer static_buffer_n @@ -189,6 +196,7 @@ buffer_cat buffer_prefix buffers + iequals ostream read_size read_size_or_throw diff --git a/example/http-server/mime_type.hpp b/example/http-server/mime_type.hpp index 07e7c437..ac9e38b4 100644 --- a/example/http-server/mime_type.hpp +++ b/example/http-server/mime_type.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_EXAMPLE_HTTP_MIME_TYPE_H_INCLUDED #define BEAST_EXAMPLE_HTTP_MIME_TYPE_H_INCLUDED -#include +#include #include #include diff --git a/extras/beast/test/pipe_stream.hpp b/extras/beast/test/pipe_stream.hpp index bcabec45..8d1a019f 100644 --- a/extras/beast/test/pipe_stream.hpp +++ b/extras/beast/test/pipe_stream.hpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/beast/core.hpp b/include/beast/core.hpp index b4b6f862..2960e542 100644 --- a/include/beast/core.hpp +++ b/include/beast/core.hpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #endif diff --git a/include/beast/core/detail/ci_char_traits.hpp b/include/beast/core/detail/ci_char_traits.hpp deleted file mode 100644 index da8bc3cd..00000000 --- a/include/beast/core/detail/ci_char_traits.hpp +++ /dev/null @@ -1,105 +0,0 @@ -// -// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BEAST_DETAIL_CI_CHAR_TRAITS_HPP -#define BEAST_DETAIL_CI_CHAR_TRAITS_HPP - -#include -#include - -namespace beast { -namespace detail { - -inline -char -tolower(signed char c) -{ - static unsigned char constexpr tab[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 - }; - return static_cast( - tab[static_cast(c)]); -} - -template -inline -string_view -string_helper(const char (&s)[N]) -{ - return string_view{s, N-1}; -} - -template -inline -T const& -string_helper(T const& t) -{ - return t; -} - -// Case-insensitive less -struct ci_less -{ - static bool const is_transparent = true; - - template - bool - operator()(S1 const& lhs, S2 const& rhs) const noexcept - { - using std::begin; - using std::end; - auto const s1 = string_helper(lhs); - auto const s2 = string_helper(rhs); - return std::lexicographical_compare( - begin(s1), end(s1), begin(s2), end(s2), - [](char lhs, char rhs) - { - return tolower(lhs) < tolower(rhs); - } - ); - } -}; - -// Case-insensitive equal -struct ci_equal_pred -{ - bool - operator()(char c1, char c2) const noexcept - { - return tolower(c1) == tolower(c2); - } -}; - -// Case-insensitive equal -template -bool -ci_equal(S1 const& lhs, S2 const& rhs) -{ - return boost::range::equal( - string_helper(lhs), string_helper(rhs), - ci_equal_pred{}); -} - -} // detail -} // beast - -#endif diff --git a/include/beast/core/detail/static_string.hpp b/include/beast/core/detail/static_string.hpp index a3e8b516..cb99fe94 100644 --- a/include/beast/core/detail/static_string.hpp +++ b/include/beast/core/detail/static_string.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_DETAIL_STATIC_STRING_HPP #define BEAST_DETAIL_STATIC_STRING_HPP -#include +#include #include #include diff --git a/include/beast/core/static_string.hpp b/include/beast/core/static_string.hpp index 8574fe03..fd324533 100644 --- a/include/beast/core/static_string.hpp +++ b/include/beast/core/static_string.hpp @@ -9,7 +9,7 @@ #define BEAST_STATIC_STRING_HPP #include -#include +#include #include #include #include diff --git a/include/beast/core/string.hpp b/include/beast/core/string.hpp new file mode 100644 index 00000000..ca265de1 --- /dev/null +++ b/include/beast/core/string.hpp @@ -0,0 +1,104 @@ +// +// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef BEAST_STRING_HPP +#define BEAST_STRING_HPP + +#include +#include + +namespace beast { + +/// The type of string view used by the library +using string_view = boost::string_ref; + +/// The type of basic string view used by the library +template +using basic_string_view = + boost::basic_string_ref; + +namespace detail { + +template +bool +iequals( + beast::string_view const& lhs, + beast::string_view const& rhs) +{ + auto n = lhs.size(); + if(rhs.size() != n) + return false; + auto p1 = lhs.data(); + auto p2 = rhs.data(); + using namespace boost::spirit::char_encoding; + while(n--) + if(ascii::tolower(*p1) != ascii::tolower(*p2)) + return false; + return true; +} + +} // detail + +/** Returns `true` if two strings are equal, using a case-insensitive comparison. + + The case-comparison operation is defined only for low-ASCII characters. + + @param lhs The string on the left side of the equality + + @param rhs The string on the right side of the equality +*/ +inline +bool +iequals( + beast::string_view const& lhs, + beast::string_view const& rhs) +{ + return detail::iequals(lhs, rhs); +} + +/** A strictly less predicate for strings, using a case-insensitive comparison. + + The case-comparison operation is defined only for low-ASCII characters. +*/ +struct iless +{ + bool + operator()( + beast::string_view const& lhs, + beast::string_view const& rhs) const + { + using std::begin; + using std::end; + using namespace boost::spirit::char_encoding; + return std::lexicographical_compare( + begin(lhs), end(lhs), begin(rhs), end(rhs), + [](char lhs, char rhs) + { + return ascii::tolower(lhs) < ascii::tolower(rhs); + } + ); + } +}; + +/** A predicate for string equality, using a case-insensitive comparison. + + The case-comparison operation is defined only for low-ASCII characters. +*/ +struct iequal +{ + bool + operator()( + beast::string_view const& lhs, + beast::string_view const& rhs) const + { + return iequals(lhs, rhs); + } +}; + +} // beast + +#endif diff --git a/include/beast/core/string_param.hpp b/include/beast/core/string_param.hpp index c71c5a6c..be16c54e 100644 --- a/include/beast/core/string_param.hpp +++ b/include/beast/core/string_param.hpp @@ -9,7 +9,7 @@ #define BEAST_STRING_PARAM_HPP #include -#include +#include #include #include diff --git a/include/beast/core/string_view.hpp b/include/beast/core/string_view.hpp deleted file mode 100644 index f3bd7b1f..00000000 --- a/include/beast/core/string_view.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BEAST_STRING_VIEW_HPP -#define BEAST_STRING_VIEW_HPP - -#include - -namespace beast { - -/// The type of string view used by the library -using string_view = boost::string_ref; - -/// The type of basic string view used by the library -template -using basic_string_view = - boost::basic_string_ref; - -} // beast - -#endif diff --git a/include/beast/http/basic_parser.hpp b/include/beast/http/basic_parser.hpp index 79612c64..672de3c1 100644 --- a/include/beast/http/basic_parser.hpp +++ b/include/beast/http/basic_parser.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/include/beast/http/detail/basic_parsed_list.hpp b/include/beast/http/detail/basic_parsed_list.hpp index 4026e158..98f9acae 100644 --- a/include/beast/http/detail/basic_parsed_list.hpp +++ b/include/beast/http/detail/basic_parsed_list.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_HTTP_DETAIL_BASIC_PARSED_LIST_HPP #define BEAST_HTTP_DETAIL_BASIC_PARSED_LIST_HPP -#include +#include #include #include #include diff --git a/include/beast/http/detail/basic_parser.hpp b/include/beast/http/detail/basic_parser.hpp index beabf2ea..dd9018f9 100644 --- a/include/beast/http/detail/basic_parser.hpp +++ b/include/beast/http/detail/basic_parser.hpp @@ -8,8 +8,7 @@ #ifndef BEAST_HTTP_DETAIL_BASIC_PARSER_HPP #define BEAST_HTTP_DETAIL_BASIC_PARSER_HPP -#include -#include +#include #include #include #include diff --git a/include/beast/http/detail/rfc7230.hpp b/include/beast/http/detail/rfc7230.hpp index b4d536e2..8a8d1f62 100644 --- a/include/beast/http/detail/rfc7230.hpp +++ b/include/beast/http/detail/rfc7230.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_HTTP_DETAIL_RFC7230_HPP #define BEAST_HTTP_DETAIL_RFC7230_HPP -#include +#include #include #include diff --git a/include/beast/http/field.hpp b/include/beast/http/field.hpp index 9dfafccb..62d6a3f7 100644 --- a/include/beast/http/field.hpp +++ b/include/beast/http/field.hpp @@ -9,7 +9,7 @@ #define BEAST_HTTP_FIELD_HPP #include -#include +#include #include namespace beast { diff --git a/include/beast/http/fields.hpp b/include/beast/http/fields.hpp index 93489439..ffc12c8d 100644 --- a/include/beast/http/fields.hpp +++ b/include/beast/http/fields.hpp @@ -10,8 +10,7 @@ #include #include -#include -#include +#include #include #include #include @@ -94,15 +93,18 @@ public: value() const; }; - /// A function that compares keys as LessThanComparable - struct key_compare : private beast::detail::ci_less + /** A strictly less predicate for comparing keys, using a case-insensitive comparison. + + The case-comparison operation is defined only for low-ASCII characters. + */ + struct key_compare : beast::iless { /// Returns `true` if lhs is less than rhs using a strict ordering template bool operator()(String const& lhs, value_type const& rhs) const { - return ci_less::operator()(lhs, rhs.name_string()); + return iless::operator()(lhs, rhs.name_string()); } /// Returns `true` if lhs is less than rhs using a strict ordering @@ -110,15 +112,14 @@ public: bool operator()(value_type const& lhs, String const& rhs) const { - return ci_less::operator()(lhs.name_string(), rhs); + return iless::operator()(lhs.name_string(), rhs); } /// Returns `true` if lhs is less than rhs using a strict ordering bool operator()(value_type const& lhs, value_type const& rhs) const { - return ci_less::operator()( - lhs.name_string(), rhs.name_string()); + return iless::operator()(lhs.name_string(), rhs.name_string()); } }; @@ -546,6 +547,7 @@ public: // //-------------------------------------------------------------------------- + /// Returns a copy of the key comparison function key_compare key_comp() const { diff --git a/include/beast/http/impl/basic_parser.ipp b/include/beast/http/impl/basic_parser.ipp index 18809c27..73bb48ea 100644 --- a/include/beast/http/impl/basic_parser.ipp +++ b/include/beast/http/impl/basic_parser.ipp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include diff --git a/include/beast/http/impl/field.ipp b/include/beast/http/impl/field.ipp index 8b4e3ae4..b2ddb48a 100644 --- a/include/beast/http/impl/field.ipp +++ b/include/beast/http/impl/field.ipp @@ -8,7 +8,6 @@ #ifndef BEAST_HTTP_IMPL_FIELD_IPP #define BEAST_HTTP_IMPL_FIELD_IPP -#include #include #include #include @@ -435,13 +434,13 @@ string_to_field(string_view s) auto const& v = get_field_strings(); auto const it = std::lower_bound( v.begin(), v.end(), s, - beast::detail::ci_less{}); + beast::iless{}); if(it == v.end()) return field::unknown; - if(! beast::detail::ci_equal(s, *it)) + if(! iequals(s, *it)) return field::unknown; - BOOST_ASSERT(beast::detail::ci_equal(s, - to_string(static_cast(it - v.begin())))); + BOOST_ASSERT(iequals(s, to_string( + static_cast(it - v.begin())))); return static_cast(it - v.begin()); } diff --git a/include/beast/http/impl/fields.ipp b/include/beast/http/impl/fields.ipp index ba2099f5..9493873f 100644 --- a/include/beast/http/impl/fields.ipp +++ b/include/beast/http/impl/fields.ipp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -298,7 +297,7 @@ value_type(field name, , f_(name) { //BOOST_ASSERT(name == field::unknown || - // detail::ci_equal(sname, to_string(name))); + // iequals(sname, to_string(name))); char* p = reinterpret_cast(this + 1); p[off_-2] = ':'; p[off_-1] = ' '; @@ -585,7 +584,7 @@ insert(field name, } auto const last = std::prev(before); // VFALCO is it worth comparing `field name` first? - if(! beast::detail::ci_equal(sname, last->name_string())) + if(! iequals(sname, last->name_string())) { BOOST_ASSERT(count(sname) == 0); set_.insert_before(before, e); @@ -779,8 +778,7 @@ has_chunked_impl() const { auto cur = it++; if(it == v.end()) - return beast::detail::ci_equal( - *cur, "chunked"); + return iequals(*cur, "chunked"); } } @@ -925,7 +923,7 @@ set_element(value_type& e) { auto it = set_.lower_bound( e.name_string(), key_compare{}); - if(it == set_.end() || ! beast::detail::ci_equal( + if(it == set_.end() || ! iequals( e.name_string(), it->name_string())) { set_.insert_before(it, e); @@ -941,8 +939,7 @@ set_element(value_type& e) delete_element(*it); it = next; if(it == set_.end() || - ! beast::detail::ci_equal( - e.name_string(), it->name_string())) + ! iequals(e.name_string(), it->name_string())) break; } set_.insert_before(it, e); diff --git a/include/beast/http/impl/message.ipp b/include/beast/http/impl/message.ipp index 45d9cf8c..78b487e0 100644 --- a/include/beast/http/impl/message.ipp +++ b/include/beast/http/impl/message.ipp @@ -9,7 +9,6 @@ #define BEAST_HTTP_IMPL_MESSAGE_IPP #include -#include #include #include #include diff --git a/include/beast/http/impl/rfc7230.ipp b/include/beast/http/impl/rfc7230.ipp index 758122a3..bce0ec85 100644 --- a/include/beast/http/impl/rfc7230.ipp +++ b/include/beast/http/impl/rfc7230.ipp @@ -8,7 +8,6 @@ #ifndef BEAST_HTTP_IMPL_RFC7230_IPP #define BEAST_HTTP_IMPL_RFC7230_IPP -#include #include #include @@ -291,7 +290,7 @@ find(T const& s) -> return std::find_if(begin(), end(), [&s](value_type const& v) { - return beast::detail::ci_equal(s, v.first); + return iequals(s, v.first); }); } @@ -537,7 +536,7 @@ exists(T const& s) return std::find_if(begin(), end(), [&s](value_type const& v) { - return beast::detail::ci_equal(s, v); + return iequals(s, v); } ) != end(); } diff --git a/include/beast/http/message.hpp b/include/beast/http/message.hpp index fdf77359..b751bcce 100644 --- a/include/beast/http/message.hpp +++ b/include/beast/http/message.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/beast/http/serializer.hpp b/include/beast/http/serializer.hpp index 4351f07e..bc2db093 100644 --- a/include/beast/http/serializer.hpp +++ b/include/beast/http/serializer.hpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/beast/http/status.hpp b/include/beast/http/status.hpp index b2e8be63..ed793ae4 100644 --- a/include/beast/http/status.hpp +++ b/include/beast/http/status.hpp @@ -9,7 +9,7 @@ #define BEAST_HTTP_STATUS_HPP #include -#include +#include #include namespace beast { diff --git a/include/beast/http/string_view_body.hpp b/include/beast/http/string_view_body.hpp index 6a7df6b2..2250694e 100644 --- a/include/beast/http/string_view_body.hpp +++ b/include/beast/http/string_view_body.hpp @@ -9,7 +9,7 @@ #define BEAST_HTTP_STRING_VIEW_BODY #include -#include +#include #include #include #include diff --git a/include/beast/http/type_traits.hpp b/include/beast/http/type_traits.hpp index 52f315ff..9f31b157 100644 --- a/include/beast/http/type_traits.hpp +++ b/include/beast/http/type_traits.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/include/beast/http/verb.hpp b/include/beast/http/verb.hpp index 73cf4ec5..679af1a6 100644 --- a/include/beast/http/verb.hpp +++ b/include/beast/http/verb.hpp @@ -9,7 +9,7 @@ #define BEAST_HTTP_VERB_HPP #include -#include +#include #include namespace beast { diff --git a/include/beast/http/write.hpp b/include/beast/http/write.hpp index 24332804..296b2b04 100644 --- a/include/beast/http/write.hpp +++ b/include/beast/http/write.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/beast/websocket/detail/hybi13.hpp b/include/beast/websocket/detail/hybi13.hpp index 7cb17c3c..ccfd8854 100644 --- a/include/beast/websocket/detail/hybi13.hpp +++ b/include/beast/websocket/detail/hybi13.hpp @@ -9,7 +9,7 @@ #define BEAST_WEBSOCKET_DETAIL_HYBI13_HPP #include -#include +#include #include #include #include diff --git a/include/beast/websocket/detail/pmd_extension.hpp b/include/beast/websocket/detail/pmd_extension.hpp index 75176b5b..83cf8d6b 100644 --- a/include/beast/websocket/detail/pmd_extension.hpp +++ b/include/beast/websocket/detail/pmd_extension.hpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -77,16 +76,15 @@ pmd_read(pmd_offer& offer, Fields const& fields) offer.server_no_context_takeover = false; offer.client_no_context_takeover = false; - using beast::detail::ci_equal; http::ext_list list{ fields["Sec-WebSocket-Extensions"]}; for(auto const& ext : list) { - if(ci_equal(ext.first, "permessage-deflate")) + if(iequals(ext.first, "permessage-deflate")) { for(auto const& param : ext.second) { - if(ci_equal(param.first, + if(iequals(param.first, "server_max_window_bits")) { if(offer.server_max_window_bits != 0) @@ -114,7 +112,7 @@ pmd_read(pmd_offer& offer, Fields const& fields) return; // MUST decline } } - else if(ci_equal(param.first, + else if(iequals(param.first, "client_max_window_bits")) { if(offer.client_max_window_bits != 0) @@ -142,7 +140,7 @@ pmd_read(pmd_offer& offer, Fields const& fields) offer.client_max_window_bits = -1; } } - else if(ci_equal(param.first, + else if(iequals(param.first, "server_no_context_takeover")) { if(offer.server_no_context_takeover) @@ -161,7 +159,7 @@ pmd_read(pmd_offer& offer, Fields const& fields) } offer.server_no_context_takeover = true; } - else if(ci_equal(param.first, + else if(iequals(param.first, "client_no_context_takeover")) { if(offer.client_no_context_takeover) diff --git a/include/beast/websocket/rfc6455.hpp b/include/beast/websocket/rfc6455.hpp index 50301b3b..c0d67b6d 100644 --- a/include/beast/websocket/rfc6455.hpp +++ b/include/beast/websocket/rfc6455.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/include/beast/websocket/stream.hpp b/include/beast/websocket/stream.hpp index 9fe4d2fb..72541820 100644 --- a/include/beast/websocket/stream.hpp +++ b/include/beast/websocket/stream.hpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/test/Jamfile b/test/Jamfile index 5fac3da3..bee625f4 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -37,8 +37,8 @@ unit-test core-tests : core/read_size.cpp core/static_buffer.cpp core/static_string.cpp + core/string.cpp core/string_param.cpp - core/string_view.cpp core/type_traits.cpp core/base64.cpp core/empty_base_optimization.cpp diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index b71d54b3..c67cea26 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -32,8 +32,8 @@ add_executable (core-tests read_size.cpp static_buffer.cpp static_string.cpp + string.cpp string_param.cpp - string_view.cpp type_traits.cpp base64.cpp empty_base_optimization.cpp diff --git a/test/core/buffer_bench.cpp b/test/core/buffer_bench.cpp index 76f3b3d2..a18fae4f 100644 --- a/test/core/buffer_bench.cpp +++ b/test/core/buffer_bench.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/test/core/buffer_test.hpp b/test/core/buffer_test.hpp index e5b0affa..3a05b459 100644 --- a/test/core/buffer_test.hpp +++ b/test/core/buffer_test.hpp @@ -8,7 +8,7 @@ #ifndef BEAST_TEST_BUFFER_TEST_HPP #define BEAST_TEST_BUFFER_TEST_HPP -#include +#include #include #include #include diff --git a/test/core/flat_buffer.cpp b/test/core/flat_buffer.cpp index 293cb5da..fda65623 100644 --- a/test/core/flat_buffer.cpp +++ b/test/core/flat_buffer.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/core/multi_buffer.cpp b/test/core/multi_buffer.cpp index f7c39e23..f2e3dbf3 100644 --- a/test/core/multi_buffer.cpp +++ b/test/core/multi_buffer.cpp @@ -11,7 +11,7 @@ #include "buffer_test.hpp" #include -#include +#include #include #include #include diff --git a/test/core/static_buffer.cpp b/test/core/static_buffer.cpp index 83a79168..b2ef000d 100644 --- a/test/core/static_buffer.cpp +++ b/test/core/static_buffer.cpp @@ -11,7 +11,7 @@ #include "buffer_test.hpp" #include -#include +#include #include #include diff --git a/test/core/string_view.cpp b/test/core/string.cpp similarity index 88% rename from test/core/string_view.cpp rename to test/core/string.cpp index b97e888f..c8afa23c 100644 --- a/test/core/string_view.cpp +++ b/test/core/string.cpp @@ -6,4 +6,4 @@ // // Test that header file is self-contained. -#include +#include diff --git a/test/http/field.cpp b/test/http/field.cpp index d5c3dca4..c44f48cc 100644 --- a/test/http/field.cpp +++ b/test/http/field.cpp @@ -9,7 +9,6 @@ #include #include -#include namespace beast { namespace http { @@ -23,8 +22,7 @@ public: auto const match = [&](field f, string_view s) { - BEAST_EXPECT( - beast::detail::ci_equal(to_string(f), s)); + BEAST_EXPECT(iequals(to_string(f), s)); BEAST_EXPECT(string_to_field(s) == f); };