diff --git a/test/beast/http/buffer_body.cpp b/test/beast/http/buffer_body.cpp index b73ad65c..bc7ab13b 100644 --- a/test/beast/http/buffer_body.cpp +++ b/test/beast/http/buffer_body.cpp @@ -9,3 +9,56 @@ // Test that header file is self-contained. #include + +#include +#include +#include +#include + +#include +#include + +namespace boost { +namespace beast { +namespace http { + +class buffer_body_test : public beast::unit_test::suite +{ +public: + void + v() + { + net::io_context ioc; + test::stream ts{ioc}; + ostream(ts.buffer()) << + "HTTP/1.1 200 OK\r\n" + "Content-Length:3\r\n" + "\r\n" + "1.0"; + error_code ec; + flat_buffer fb; + response_parser p; + char buf[256]; + p.get().body().data = buf; + p.get().body().size = sizeof(buf); + read_header(ts, fb, p, ec); + auto const bytes_transferred = + read(ts, fb, p, ec); + BEAST_EXPECTS(! ec, ec.message()); + + // VFALCO What should the read algorithms return? + //BEAST_EXPECT(bytes_transferred == 3); + } + + void + run() override + { + testIssue1717(); + } +}; + +BEAST_DEFINE_TESTSUITE(beast,http,buffer_body); + +} // http +} // beast +} // boost diff --git a/test/beast/http/write.cpp b/test/beast/http/write.cpp index 88255d58..f6cfadea 100644 --- a/test/beast/http/write.cpp +++ b/test/beast/http/write.cpp @@ -10,7 +10,6 @@ // Test that header file is self-contained. #include -#include #include #include #include