GCC Code Coverage Report


Directory: ./
File: libs/buffers/src/any_buffers.cpp
Date: 2025-12-08 17:18:03
Exec Total Coverage
Lines: 60 68 88.2%
Functions: 26 28 92.9%
Branches: 6 8 75.0%

Line Branch Exec Source
1 //
2 // Copyright (c) 2025 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/buffers
8 //
9
10 #include <boost/buffers/any_buffers.hpp>
11 #include <boost/buffers/detail/except.hpp>
12
13 namespace boost {
14 namespace buffers {
15
16 template<>
17 185 any_buffers<true>::
18 185 any_buffers() noexcept
19 {
20 struct impl : any_impl
21 {
22 1 bool is_small_buffers() const noexcept override
23 {
24 1 return true;
25 }
26
27 1 bool is_small_iter() const noexcept override
28 {
29 1 return true;
30 }
31
32 578 void destroy() const override
33 {
34 578 }
35
36 393 void copy(any_buffers& dest) const override
37 {
38 393 dest.p_ = this;
39 393 }
40
41 1985 void it_copy(void*, void const*) const override
42 {
43 1985 }
44
45 4013 void it_destroy(void*) const override
46 {
47 4013 }
48
49 1 void inc(void*) const override
50 {
51 1 }
52
53 1 void dec(void*) const override
54 {
55 1 }
56
57 3 value_type deref(void const*) const override
58 {
59 3 return {};
60 }
61
62 1013 bool equal(void const*, void const*) const override
63 {
64 1013 return true;
65 }
66
67 1994 void begin(void*) const override
68 {
69 1994 }
70
71 34 void end(void*) const override
72 {
73 34 }
74 };
75
76
3/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 184 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
185 static impl const instance;
77 185 p_ = &instance;
78 185 }
79
80 template<>
81 95 any_buffers<false>::
82 95 any_buffers() noexcept
83 {
84 struct impl : any_impl
85 {
86 2 bool is_small_buffers() const noexcept override
87 {
88 2 return true;
89 }
90
91 2 bool is_small_iter() const noexcept override
92 {
93 2 return true;
94 }
95
96 396 void destroy() const override
97 {
98 396 }
99
100 301 void copy(any_buffers& dest) const override
101 {
102 301 dest.p_ = this;
103 301 }
104
105 1985 void it_copy(void*, void const*) const override
106 {
107 1985 }
108
109 4017 void it_destroy(void*) const override
110 {
111 4017 }
112
113 1 void inc(void*) const override
114 {
115 1 }
116
117 1 void dec(void*) const override
118 {
119 1 }
120
121 3 value_type deref(void const*) const override
122 {
123 3 return {};
124 }
125
126 1015 bool equal(void const*, void const*) const override
127 {
128 1015 return true;
129 }
130
131 1996 void begin(void*) const override
132 {
133 1996 }
134
135 36 void end(void*) const override
136 {
137 36 }
138 };
139
140
3/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 94 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
95 static impl const instance;
141 95 p_ = &instance;
142 95 }
143
144 template<>
145 any_buffers<true>::
146 any_buffers::
147 const_iterator::
148 const_iterator() noexcept
149 : p_(any_buffers<true>().begin().p_)
150 {
151 }
152
153 template<>
154 any_buffers<false>::
155 any_buffers::
156 const_iterator::
157 const_iterator() noexcept
158 : p_(any_buffers<false>().begin().p_)
159 {
160 }
161
162 } // buffers
163 } // boost
164