forked from boostorg/beast
1 parent
1b616fa1da
commit
cd9f41b1a0
19 files changed
+142
-203
No files matched your search
+16
-28
@@ -216,50 +216,38 @@ public:
|
||||
};
|
||||
|
||||
// Check is_all_const_buffer_sequence
|
||||
static_assert(
|
||||
detail::is_all_const_buffer_sequence<
|
||||
const_buffers_1
|
||||
>::value, "");
|
||||
static_assert(
|
||||
detail::is_all_const_buffer_sequence<
|
||||
const_buffers_1, const_buffers_1
|
||||
>::value, "");
|
||||
static_assert(
|
||||
detail::is_all_const_buffer_sequence<
|
||||
mutable_buffers_1
|
||||
>::value, "");
|
||||
static_assert(
|
||||
detail::is_all_const_buffer_sequence<
|
||||
mutable_buffers_1, mutable_buffers_1
|
||||
>::value, "");
|
||||
static_assert(
|
||||
detail::is_all_const_buffer_sequence<
|
||||
const_buffers_1, mutable_buffers_1
|
||||
>::value, "");
|
||||
static_assert(
|
||||
! detail::is_all_const_buffer_sequence<
|
||||
const_buffers_1, mutable_buffers_1, int
|
||||
>::value, "");
|
||||
BOOST_STATIC_ASSERT(
|
||||
detail::is_all_const_buffer_sequence<const_buffers_1>::value);
|
||||
BOOST_STATIC_ASSERT(
|
||||
detail::is_all_const_buffer_sequence<const_buffers_1, const_buffers_1>::value);
|
||||
BOOST_STATIC_ASSERT(
|
||||
detail::is_all_const_buffer_sequence<mutable_buffers_1>::value);
|
||||
BOOST_STATIC_ASSERT(
|
||||
detail::is_all_const_buffer_sequence<mutable_buffers_1, mutable_buffers_1>::value);
|
||||
BOOST_STATIC_ASSERT(
|
||||
detail::is_all_const_buffer_sequence<const_buffers_1, mutable_buffers_1>::value);
|
||||
BOOST_STATIC_ASSERT(
|
||||
! detail::is_all_const_buffer_sequence<const_buffers_1, mutable_buffers_1, int>::value);
|
||||
|
||||
// Ensure that concatenating mutable buffer
|
||||
// sequences results in a mutable buffer sequence
|
||||
static_assert(std::is_same<
|
||||
BOOST_STATIC_ASSERT(std::is_same<
|
||||
mutable_buffer,
|
||||
decltype(buffer_cat(
|
||||
std::declval<mutable_buffer>(),
|
||||
std::declval<user_defined>(),
|
||||
std::declval<mutable_buffer>()
|
||||
))::value_type>::value, "");
|
||||
))::value_type>::value);
|
||||
|
||||
// Ensure that concatenating mixed buffer
|
||||
// sequences results in a const buffer sequence.
|
||||
static_assert(std::is_same<
|
||||
BOOST_STATIC_ASSERT(std::is_same<
|
||||
const_buffer,
|
||||
decltype(buffer_cat(
|
||||
std::declval<mutable_buffer>(),
|
||||
std::declval<user_defined>(),
|
||||
std::declval<const_buffer>()
|
||||
))::value_type>::value, "");
|
||||
))::value_type>::value);
|
||||
|
||||
testBufferCat();
|
||||
testIterators();
|
||||
|
||||
@@ -16,24 +16,24 @@
|
||||
|
||||
namespace beast {
|
||||
|
||||
static_assert(
|
||||
BOOST_STATIC_ASSERT(
|
||||
std::is_same<boost::asio::const_buffer, decltype(
|
||||
buffer_prefix(0,
|
||||
std::declval<boost::asio::const_buffer>()))>::value, "");
|
||||
std::declval<boost::asio::const_buffer>()))>::value);
|
||||
|
||||
static_assert(
|
||||
BOOST_STATIC_ASSERT(
|
||||
is_const_buffer_sequence<decltype(
|
||||
buffer_prefix(0,
|
||||
std::declval<boost::asio::const_buffers_1>()))>::value, "");
|
||||
std::declval<boost::asio::const_buffers_1>()))>::value);
|
||||
|
||||
static_assert(
|
||||
BOOST_STATIC_ASSERT(
|
||||
std::is_same<boost::asio::mutable_buffer, decltype(
|
||||
buffer_prefix(0,
|
||||
std::declval<boost::asio::mutable_buffer>()))>::value, "");
|
||||
static_assert(
|
||||
std::declval<boost::asio::mutable_buffer>()))>::value);
|
||||
BOOST_STATIC_ASSERT(
|
||||
is_mutable_buffer_sequence<decltype(
|
||||
buffer_prefix(0,
|
||||
std::declval<boost::asio::mutable_buffers_1>()))>::value, "");
|
||||
std::declval<boost::asio::mutable_buffers_1>()))>::value);
|
||||
|
||||
class buffer_prefix_test : public beast::unit_test::suite
|
||||
{
|
||||
|
||||
@@ -108,7 +108,7 @@ void
|
||||
check_read_size_helper()
|
||||
{
|
||||
static_assert(has_read_size_helper::trait<DynamicBuffer>::value,
|
||||
"Missing read_size_helper for dynamic buffer");
|
||||
"Missing read_size_helper for dynamic buffer");
|
||||
}
|
||||
|
||||
} // test
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
namespace beast {
|
||||
|
||||
static_assert(is_dynamic_buffer<multi_buffer>::value, "");
|
||||
BOOST_STATIC_ASSERT(is_dynamic_buffer<multi_buffer>::value);
|
||||
|
||||
class multi_buffer_test : public beast::unit_test::suite
|
||||
{
|
||||
|
||||
+33
-61
@@ -37,26 +37,13 @@ struct is_invocable_udt3
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
// VFALCO Fails to compile with Intellisense
|
||||
static_assert(is_invocable<
|
||||
is_invocable_udt1, void(int)>::value, "");
|
||||
|
||||
static_assert(! is_invocable<
|
||||
is_invocable_udt1, void(void)>::value, "");
|
||||
|
||||
static_assert(is_invocable<
|
||||
is_invocable_udt2, int(int)>::value, "");
|
||||
|
||||
static_assert(! is_invocable<
|
||||
is_invocable_udt2, int(void)>::value, "");
|
||||
|
||||
static_assert(! is_invocable<
|
||||
is_invocable_udt2, void(void)>::value, "");
|
||||
|
||||
static_assert(is_invocable<
|
||||
is_invocable_udt3, int(int)>::value, "");
|
||||
|
||||
static_assert(! is_invocable<
|
||||
is_invocable_udt3 const, int(int)>::value, "");
|
||||
BOOST_STATIC_ASSERT(is_invocable<is_invocable_udt1, void(int)>::value);
|
||||
BOOST_STATIC_ASSERT(is_invocable<is_invocable_udt2, int(int)>::value);
|
||||
BOOST_STATIC_ASSERT(is_invocable<is_invocable_udt3, int(int)>::value);
|
||||
BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt1, void(void)>::value);
|
||||
BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt2, int(void)>::value);
|
||||
BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt2, void(void)>::value);
|
||||
BOOST_STATIC_ASSERT(! is_invocable<is_invocable_udt3 const, int(int)>::value);
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -86,29 +73,14 @@ struct F4
|
||||
get_lowest_layer<next_layer_type>::type;
|
||||
};
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F1>::type, F1>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F2>::type, F2>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F3<F1>>::type, F1>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F3<F2>>::type, F2>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F4<F1>>::type, F1>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F4<F2>>::type, F2>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F4<F3<F1>>>::type, F1>::value, "");
|
||||
|
||||
static_assert(std::is_same<
|
||||
get_lowest_layer<F4<F3<F2>>>::type, F2>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F1>::type, F1>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F2>::type, F2>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F3<F1>>::type, F1>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F3<F2>>::type, F2>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F4<F1>>::type, F1>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F4<F2>>::type, F2>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F4<F3<F1>>>::type, F1>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_same<get_lowest_layer<F4<F3<F2>>>::type, F2>::value);
|
||||
|
||||
} // (anonymous)
|
||||
|
||||
@@ -122,11 +94,11 @@ namespace {
|
||||
|
||||
struct T {};
|
||||
|
||||
static_assert(is_const_buffer_sequence<detail::ConstBufferSequence>::value, "");
|
||||
static_assert(! is_const_buffer_sequence<T>::value, "");
|
||||
BOOST_STATIC_ASSERT(is_const_buffer_sequence<detail::ConstBufferSequence>::value);
|
||||
BOOST_STATIC_ASSERT(! is_const_buffer_sequence<T>::value);
|
||||
|
||||
static_assert(is_mutable_buffer_sequence<detail::MutableBufferSequence>::value, "");
|
||||
static_assert(! is_mutable_buffer_sequence<T>::value, "");
|
||||
BOOST_STATIC_ASSERT(is_mutable_buffer_sequence<detail::MutableBufferSequence>::value);
|
||||
BOOST_STATIC_ASSERT(! is_mutable_buffer_sequence<T>::value);
|
||||
|
||||
} // (anonymous)
|
||||
|
||||
@@ -143,8 +115,8 @@ struct H
|
||||
|
||||
} // anonymous
|
||||
|
||||
static_assert(is_completion_handler<H, void(int)>::value, "");
|
||||
static_assert(! is_completion_handler<H, void(void)>::value, "");
|
||||
BOOST_STATIC_ASSERT(is_completion_handler<H, void(int)>::value);
|
||||
BOOST_STATIC_ASSERT(! is_completion_handler<H, void(void)>::value);
|
||||
|
||||
//
|
||||
// stream concepts
|
||||
@@ -154,19 +126,19 @@ static_assert(! is_completion_handler<H, void(void)>::value, "");
|
||||
|
||||
using stream_type = boost::asio::ip::tcp::socket;
|
||||
|
||||
static_assert(has_get_io_service<stream_type>::value, "");
|
||||
static_assert(is_async_read_stream<stream_type>::value, "");
|
||||
static_assert(is_async_write_stream<stream_type>::value, "");
|
||||
static_assert(is_async_stream<stream_type>::value, "");
|
||||
static_assert(is_sync_read_stream<stream_type>::value, "");
|
||||
static_assert(is_sync_write_stream<stream_type>::value, "");
|
||||
static_assert(is_sync_stream<stream_type>::value, "");
|
||||
BOOST_STATIC_ASSERT(has_get_io_service<stream_type>::value);
|
||||
BOOST_STATIC_ASSERT(is_async_read_stream<stream_type>::value);
|
||||
BOOST_STATIC_ASSERT(is_async_write_stream<stream_type>::value);
|
||||
BOOST_STATIC_ASSERT(is_async_stream<stream_type>::value);
|
||||
BOOST_STATIC_ASSERT(is_sync_read_stream<stream_type>::value);
|
||||
BOOST_STATIC_ASSERT(is_sync_write_stream<stream_type>::value);
|
||||
BOOST_STATIC_ASSERT(is_sync_stream<stream_type>::value);
|
||||
|
||||
static_assert(! has_get_io_service<int>::value, "");
|
||||
static_assert(! is_async_read_stream<int>::value, "");
|
||||
static_assert(! is_async_write_stream<int>::value, "");
|
||||
static_assert(! is_sync_read_stream<int>::value, "");
|
||||
static_assert(! is_sync_write_stream<int>::value, "");
|
||||
BOOST_STATIC_ASSERT(! has_get_io_service<int>::value);
|
||||
BOOST_STATIC_ASSERT(! is_async_read_stream<int>::value);
|
||||
BOOST_STATIC_ASSERT(! is_async_write_stream<int>::value);
|
||||
BOOST_STATIC_ASSERT(! is_sync_read_stream<int>::value);
|
||||
BOOST_STATIC_ASSERT(! is_sync_write_stream<int>::value);
|
||||
|
||||
//} // (anonymous)
|
||||
|
||||
|
||||
+28
-28
@@ -73,39 +73,39 @@ public:
|
||||
void
|
||||
testMessage()
|
||||
{
|
||||
static_assert(std::is_constructible<
|
||||
message<true, default_body, fields>>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, default_body, fields>>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1 const>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1 const>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1 const&>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1 const&>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1&&>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, Arg1&&>::value);
|
||||
|
||||
static_assert(! std::is_constructible<
|
||||
message<true, one_arg_body, fields>>::value, "");
|
||||
BOOST_STATIC_ASSERT(! std::is_constructible<
|
||||
message<true, one_arg_body, fields>>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, one_arg_body, fields>,
|
||||
Arg1, fields::allocator_type>::value, "");
|
||||
Arg1, fields::allocator_type>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, one_arg_body, fields>, std::piecewise_construct_t,
|
||||
std::tuple<Arg1>>::value, "");
|
||||
std::tuple<Arg1>>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, two_arg_body, fields>, std::piecewise_construct_t,
|
||||
std::tuple<Arg1, Arg2>>::value, "");
|
||||
std::tuple<Arg1, Arg2>>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
message<true, two_arg_body, fields>, std::piecewise_construct_t,
|
||||
std::tuple<Arg1, Arg2>, std::tuple<fields::allocator_type>>::value, "");
|
||||
std::tuple<Arg1, Arg2>, std::tuple<fields::allocator_type>>::value);
|
||||
|
||||
{
|
||||
Arg1 arg1;
|
||||
@@ -171,16 +171,16 @@ public:
|
||||
{
|
||||
{
|
||||
using req_type = request_header;
|
||||
static_assert(std::is_copy_constructible<req_type>::value, "");
|
||||
static_assert(std::is_move_constructible<req_type>::value, "");
|
||||
static_assert(std::is_copy_assignable<req_type>::value, "");
|
||||
static_assert(std::is_move_assignable<req_type>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_copy_constructible<req_type>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_move_constructible<req_type>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_copy_assignable<req_type>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_move_assignable<req_type>::value);
|
||||
|
||||
using res_type = response_header;
|
||||
static_assert(std::is_copy_constructible<res_type>::value, "");
|
||||
static_assert(std::is_move_constructible<res_type>::value, "");
|
||||
static_assert(std::is_copy_assignable<res_type>::value, "");
|
||||
static_assert(std::is_move_assignable<res_type>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_copy_constructible<res_type>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_move_constructible<res_type>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_copy_assignable<res_type>::value);
|
||||
BOOST_STATIC_ASSERT(std::is_move_assignable<res_type>::value);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
+12
-12
@@ -1837,23 +1837,23 @@ public:
|
||||
|
||||
void run() override
|
||||
{
|
||||
static_assert(std::is_constructible<
|
||||
stream<socket_type>, boost::asio::io_service&>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
stream<socket_type>, boost::asio::io_service&>::value);
|
||||
|
||||
static_assert(std::is_move_constructible<
|
||||
stream<socket_type>>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_move_constructible<
|
||||
stream<socket_type>>::value);
|
||||
|
||||
static_assert(std::is_move_assignable<
|
||||
stream<socket_type>>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_move_assignable<
|
||||
stream<socket_type>>::value);
|
||||
|
||||
static_assert(std::is_constructible<
|
||||
stream<socket_type&>, socket_type&>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_constructible<
|
||||
stream<socket_type&>, socket_type&>::value);
|
||||
|
||||
static_assert(std::is_move_constructible<
|
||||
stream<socket_type&>>::value, "");
|
||||
BOOST_STATIC_ASSERT(std::is_move_constructible<
|
||||
stream<socket_type&>>::value);
|
||||
|
||||
static_assert(! std::is_move_assignable<
|
||||
stream<socket_type&>>::value, "");
|
||||
BOOST_STATIC_ASSERT(! std::is_move_assignable<
|
||||
stream<socket_type&>>::value);
|
||||
|
||||
log << "sizeof(websocket::stream) == " <<
|
||||
sizeof(websocket::stream<boost::asio::ip::tcp::socket&>) << std::endl;
|
||||
|
||||
Reference in new issue
Block a user