Boost prep

This commit is contained in:
Vinnie Falco
2017-07-23 17:34:13 -07:00
parent 3777cb8b9c
commit 7139dd639a
375 changed files with 5253 additions and 3884 deletions
+14 -10
View File
@@ -4,13 +4,16 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/boostorg/beast
//
// Test that header file is self-contained.
#include <beast/core/drain_buffer.hpp>
#include <boost/beast/core/drain_buffer.hpp>
#include <beast/core/type_traits.hpp>
#include <beast/unit_test/suite.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/unit_test/suite.hpp>
namespace boost {
namespace beast {
static_assert(is_dynamic_buffer<drain_buffer>::value,
@@ -24,8 +27,8 @@ public:
{
using boost::asio::buffer_size;
drain_buffer b;
BEAST_EXPECT(buffer_size(b.prepare(0)) == 0);
BEAST_EXPECT(buffer_size(b.prepare(100)) == 100);
BOOST_BEAST_EXPECT(buffer_size(b.prepare(0)) == 0);
BOOST_BEAST_EXPECT(buffer_size(b.prepare(100)) == 100);
try
{
b.prepare(b.max_size() + 1);
@@ -36,16 +39,17 @@ public:
pass();
}
b.prepare(10);
BEAST_EXPECT(b.size() == 0);
BOOST_BEAST_EXPECT(b.size() == 0);
b.commit(10);
BEAST_EXPECT(b.size() == 0);
BOOST_BEAST_EXPECT(b.size() == 0);
b.consume(10);
BEAST_EXPECT(b.size() == 0);
BOOST_BEAST_EXPECT(b.size() == 0);
b.consume(1000);
BEAST_EXPECT(b.size() == 0);
BOOST_BEAST_EXPECT(b.size() == 0);
}
};
BEAST_DEFINE_TESTSUITE(drain_buffer,core,beast);
BOOST_BEAST_DEFINE_TESTSUITE(drain_buffer,core,beast);
} // beast
} // boost