GCC Code Coverage Report


Directory: ./
File: libs/http_proto/src/file_sink.cpp
Date: 2025-12-25 12:14:37
Exec Total Coverage
Lines: 11 12 91.7%
Functions: 3 4 75.0%
Branches: 5 6 83.3%

Line Branch Exec Source
1 //
2 // Copyright (c) 2022 Vinnie Falco (vinnie.falco@gmail.com)
3 // Copyright (c) 2025 Mohammad Nejati
4 //
5 // Distributed under the Boost Software License, Version 1.0. (See accompanying
6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 //
8 // Official repository: https://github.com/cppalliance/http_proto
9 //
10
11 #include <boost/http_proto/file_sink.hpp>
12
13 namespace boost {
14 namespace http_proto {
15
16 2 file_sink::
17 file_sink(
18 2 capy::file&& f) noexcept
19 2 : f_(std::move(f))
20 {
21 2 }
22
23 file_sink::
24 file_sink(file_sink&&) noexcept = default;
25
26 2 file_sink::
27 ~file_sink() = default;
28
29 auto
30 5 file_sink::
31 on_write(
32 buffers::const_buffer b,
33 bool more) -> results
34 {
35 5 results rv;
36 5 rv.bytes = f_.write(
37 b.data(), b.size(), rv.ec);
38
5/6
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 4 times.
5 if(!more && !rv.ec)
39 1 f_.close(rv.ec);
40 5 return rv;
41 }
42
43 } // http_proto
44 } // boost
45