GCC Code Coverage Report


Directory: libs/http_proto/include/boost/http_proto/
File: boost/http_proto/impl/sink.ipp
Date: 2023-12-22 17:54:30
Exec Total Coverage
Lines: 15 15 100.0%
Functions: 1 1 100.0%
Branches: 10 12 83.3%

Line Branch Exec Source
1 //
2 // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/CPPAlliance/http_proto
8 //
9
10 #ifndef BOOST_HTTP_PROTO_IMPL_SINK_IPP
11 #define BOOST_HTTP_PROTO_IMPL_SINK_IPP
12
13 #include <boost/http_proto/sink.hpp>
14
15 namespace boost {
16 namespace http_proto {
17
18 auto
19 5 sink::
20 on_write(
21 buffers::const_buffer_span bs,
22 bool more) ->
23 results
24 {
25 5 auto it = bs.begin();
26 5 auto const end_ = bs.end();
27 5 results rv;
28
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
5 if(it == end_)
29 1 return rv;
30 5 do
31 {
32 9 buffers::const_buffer b(*it++);
33 9 rv += on_write(b,
34
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
9 it != end_ ||
35
3/4
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 7 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
18 more);
36
2/2
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 6 times.
9 if(rv.ec.failed())
37 3 return rv;
38 }
39
2/2
✓ Branch 0 taken 5 times.
✓ Branch 1 taken 1 times.
6 while(it != end_);
40 1 return rv;
41 }
42
43 } // http_proto
44 } // boost
45
46 #endif
47