mirror of
https://github.com/boostorg/beast.git
synced 2026-01-29 09:50:07 +01:00
read_size replaces read_size_helper:
* detail::read_size_helper is removed * public function read_size helps determine the optimum size for calls to a DynamicBuffer's prepare function. * special case for Asio types which don't conform to the concept but have their own helper function.
This commit is contained in:
@@ -190,19 +190,18 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// read_size_helper
|
||||
// read_size
|
||||
{
|
||||
using detail::read_size_helper;
|
||||
static_buffer_n<10> b;
|
||||
BEAST_EXPECT(read_size_helper(b, 512) == 10);
|
||||
BEAST_EXPECT(read_size(b, 512) == 10);
|
||||
b.prepare(4);
|
||||
b.commit(4);
|
||||
BEAST_EXPECT(read_size_helper(b, 512) == 6);
|
||||
BEAST_EXPECT(read_size(b, 512) == 6);
|
||||
b.consume(2);
|
||||
BEAST_EXPECT(read_size_helper(b, 512) == 8);
|
||||
BEAST_EXPECT(read_size(b, 512) == 8);
|
||||
b.prepare(8);
|
||||
b.commit(8);
|
||||
BEAST_EXPECT(read_size_helper(b, 512) == 0);
|
||||
BEAST_EXPECT(read_size(b, 512) == 0);
|
||||
}
|
||||
|
||||
// base
|
||||
@@ -224,8 +223,6 @@ public:
|
||||
|
||||
void run() override
|
||||
{
|
||||
test::check_read_size_helper<static_buffer_n<32>>();
|
||||
|
||||
testBuffer();
|
||||
//testStaticBuffer();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user