22 { std::array<boost::asio::const_buffer, 3u> s; buffer.
copy_from(s); }
23 { std::array<boost::asio::mutable_buffer, 3u> s; buffer.
copy_from(s); }
24 { std::vector<boost::asio::const_buffer> s; buffer.
copy_from(s); }
25 { std::vector<boost::asio::mutable_buffer> s; buffer.
copy_from(s); }
26 { std::list<boost::asio::const_buffer> s; buffer.
copy_from(s); }
27 { std::list<boost::asio::mutable_buffer> s; buffer.
copy_from(s); }
28 { std::set<boost::asio::const_buffer> s; buffer.
copy_from(s); }
29 { std::set<boost::asio::mutable_buffer> s; buffer.
copy_from(s); }
31 { boost::asio::const_buffer v; buffer.
copy_from(v); }
32 { boost::asio::mutable_buffer v; buffer.
copy_from(v); }
34 { std::vector<int> v; buffer.
copy_from(v); }
37 {
struct C {
int x = 0; } v[3u]; buffer.
copy_from(v); }
38 {
struct C {
int x = 0; }; std::array<C, 3u> v; buffer.
copy_from(v); }
39 {
struct C {
int x = 0; }; std::vector<C> v; buffer.
copy_from(v); }
42TEST(buffer, copy_buffer_sequence) {
43 constexpr auto number_of_buffers = 15u;
44 const std::string str =
"WXdI<x->+<If$ua>$pu1AUBmS]?_PT{3z$B7L(E|?$]";
46 std::array<Buffer, number_of_buffers> buffers;
47 std::array<boost::asio::const_buffer, number_of_buffers> sequence;
48 for (
auto i = 0u; i < number_of_buffers; ++i) {
50 buffers[i].copy_from(str);
51 sequence[i] = buffers[i].buffer();
53 auto result =
Buffer(sequence);
54 ASSERT_EQ(result.size(), message.size());
56 ASSERT_EQ(result_str, message);