static_buffer coverage

This commit is contained in:
Vinnie Falco
2017-07-20 08:12:19 -07:00
parent 4a3b42b398
commit 99f2425de4
7 changed files with 210 additions and 32 deletions
@@ -44,9 +44,7 @@ read_size_helper(
BOOST_ASSERT(max_size >= 1);
auto const size = buffer.size();
auto const limit = buffer.max_size() - size;
if(limit <= 0)
BOOST_THROW_EXCEPTION(std::length_error{
"dynamic buffer overflow"});
BOOST_ASSERT(size <= buffer.max_size());
return std::min<std::size_t>(
std::max<std::size_t>(512, buffer.capacity() - size),
std::min<std::size_t>(max_size, limit));