GCC Code Coverage Report


Directory: libs/http_proto/
File: src/response.cpp
Date: 2025-09-21 18:08:15
Exec Total Coverage
Lines: 45 45 100.0%
Functions: 9 9 100.0%
Branches: 4 6 66.7%

Line Branch Exec Source
1 //
2 // Copyright (c) 2021 Vinnie Falco (vinnie.falco@gmail.com)
3 // Copyright (c) 2024 Christian Mazakas
4 // Copyright (c) 2025 Mohammad Nejati
5 //
6 // Distributed under the Boost Software License, Version 1.0. (See accompanying
7 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 //
9 // Official repository: https://github.com/cppalliance/http_proto
10 //
11
12 #include <boost/http_proto/response.hpp>
13 #include <boost/http_proto/version.hpp>
14
15 #include <utility>
16
17 namespace boost {
18 namespace http_proto {
19
20 196 response::
21 196 response() noexcept
22 : fields_view_base(
23 196 &this->fields_base::h_)
24 196 , response_base()
25 {
26 196 }
27
28 200 response::
29 response(
30 200 core::string_view s)
31 : fields_view_base(
32 200 &this->fields_base::h_)
33 200 , response_base(s)
34 {
35 198 }
36
37 20 response::
38 response(
39 std::size_t cap,
40 20 std::size_t max_cap)
41 20 : response()
42 {
43
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
20 reserve_bytes(cap);
44
2/2
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
20 set_max_capacity_in_bytes(max_cap);
45 20 }
46
47 6 response::
48 response(
49 6 response&& other) noexcept
50 6 : response()
51 {
52 6 swap(other);
53 6 }
54
55 4 response::
56 response(
57 4 response const& other)
58 : fields_view_base(
59 4 &this->fields_base::h_)
60 4 , response_base(*other.ph_)
61 {
62 4 }
63
64 4 response::
65 response(
66 4 response_view const& other)
67 : fields_view_base(
68 4 &this->fields_base::h_)
69 4 , response_base(*other.ph_)
70 {
71 4 }
72
73 response&
74 1 response::
75 operator=(
76 response&& other) noexcept
77 {
78 response temp(
79 1 std::move(other));
80 1 temp.swap(*this);
81 2 return *this;
82 1 }
83
84 6 response::
85 response(
86 6 http_proto::status sc)
87 : response(
88 6 sc, http_proto::version::http_1_1)
89 {
90 6 }
91
92 22 response::
93 response(
94 http_proto::status sc,
95 22 http_proto::version v)
96 22 : response()
97 {
98
1/2
✓ Branch 1 taken 11 times.
✗ Branch 2 not taken.
22 set_start_line(sc, v);
99 22 }
100
101 } // http_proto
102 } // boost
103