Use buffers_to_string in tests

fix #782
This commit is contained in:
Vinnie Falco
2018-04-24 10:55:39 -07:00
parent 5abac8b380
commit 14392d7f52
21 changed files with 164 additions and 281 deletions

View File

@ -53,19 +53,6 @@ public:
return ss.str();
}
template<class ConstBufferSequence>
static
std::string
to_string(ConstBufferSequence const& bs)
{
std::string s;
s.reserve(buffer_size(bs));
for(auto b : beast::detail::buffers_range(bs))
s.append(reinterpret_cast<
char const*>(b.data()), b.size());
return s;
}
template<bool isRequest>
bool
equal_body(string_view sv, string_view body)
@ -368,7 +355,7 @@ public:
std::allocator<double>{}
), ec);
BEAST_EXPECT(
to_string(tr.buffer().data()) ==
buffers_to_string(tr.buffer().data()) ==
"HTTP/1.1 200 OK\r\n"
"Server: test\r\n"
"Accept: Expires, Content-MD5\r\n"