Tidy up tests and docs:

* Add handler_ptr test and increase coverage
* Add test for prepare_buffer
* Move is_call_possible tests to a .cpp file
* Tidy up docs and declarations
This commit is contained in:
Vinnie Falco
2017-07-20 08:12:14 -07:00
parent 7ef72b6ebc
commit 51aa614a10
19 changed files with 372 additions and 136 deletions
+27 -6
View File
@@ -6,23 +6,44 @@
//
// Test that header file is self-contained.
#include <beast/core/to_string.hpp>
#include <beast/core/handler_alloc.hpp>
#include <beast/unit_test/suite.hpp>
#include <boost/asio/buffer.hpp>
#include <vector>
namespace beast {
class to_string_test : public beast::unit_test::suite
class handler_alloc_test : public beast::unit_test::suite
{
public:
void run()
struct handler
{
BEAST_EXPECT(to_string(boost::asio::const_buffers_1("x", 1)) == "x");
void
operator()() const
{
}
};
void
run() override
{
handler h;
handler h2;
handler_alloc<char, handler> a1{h};
handler_alloc<char, handler> a2{h2};
BEAST_EXPECT(a2 == a1);
auto a3 = a1;
BEAST_EXPECT(a3 == a1);
{
std::vector<char,
handler_alloc<char, handler>> v(a1);
v.reserve(32);
v.resize(10);
}
}
};
BEAST_DEFINE_TESTSUITE(to_string,core,beast);
BEAST_DEFINE_TESTSUITE(handler_alloc,core,beast);
} // beast