Improvements to increase code coverage:

* Don't include the test code in coverage reports
* Add test code for missing coverage

Other:

* Improve the README.md
* Fix warning in sha1_context
* Tidy up the examples use of namespaces
* Various fixes to documentation and javadocs
This commit is contained in:
Vinnie Falco
2016-05-04 17:27:50 -04:00
parent 8499cc9767
commit 1b44c9a3df
49 changed files with 1054 additions and 447 deletions

View File

@@ -8,6 +8,7 @@
// Test that header file is self-contained.
#include <beast/buffers_adapter.hpp>
#include <beast/streambuf.hpp>
#include <beast/detail/unit_test/suite.hpp>
#include <boost/asio/buffer.hpp>
#include <boost/asio/streambuf.hpp>
@@ -149,9 +150,38 @@ public:
}
}}}}}}
}
void testCommit()
{
using boost::asio::buffer_size;
{
using sb_type = boost::asio::streambuf;
sb_type sb;
buffers_adapter<
sb_type::mutable_buffers_type> ba(sb.prepare(3));
expect(buffer_size(ba.prepare(3)) == 3);
ba.commit(2);
expect(buffer_size(ba.data()) == 2);
}
{
using sb_type = beast::streambuf;
sb_type sb(2);
sb.prepare(3);
buffers_adapter<
sb_type::mutable_buffers_type> ba(sb.prepare(8));
expect(buffer_size(ba.prepare(8)) == 8);
ba.commit(2);
expect(buffer_size(ba.data()) == 2);
ba.consume(1);
ba.commit(6);
ba.consume(2);
expect(buffer_size(ba.data()) == 5);
ba.consume(5);
}
}
void run() override
{
testBuffersAdapter();
testCommit();
}
};