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 committed 2017-07-20 08:12:06 -07:00
1 parent 231988622c
commit 133e7a3b16
49 files changed
+1054 -447

No files matched your search

+30
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();
}
};