GCC Code Coverage Report


Directory: ./
File: libs/http/src/server/statuses.cpp
Date: 2026-01-20 00:11:35
Exec Total Coverage
Lines: 18 18 100.0%
Functions: 3 3 100.0%
Branches: 6 6 100.0%

Line Branch Exec Source
1 //
2 // Copyright (c) 2025 Vinnie Falco (vinnie dot falco at gmail dot 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
8 //
9
10 #include <boost/http/server/statuses.hpp>
11
12 namespace boost {
13 namespace http {
14 namespace statuses {
15
16 bool
17 6 is_empty( unsigned code ) noexcept
18 {
19
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 3 times.
6 switch( code )
20 {
21 3 case 204: // No Content
22 case 205: // Reset Content
23 case 304: // Not Modified
24 3 return true;
25 3 default:
26 3 return false;
27 }
28 }
29
30 bool
31 9 is_redirect( unsigned code ) noexcept
32 {
33
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 3 times.
9 switch( code )
34 {
35 6 case 300: // Multiple Choices
36 case 301: // Moved Permanently
37 case 302: // Found
38 case 303: // See Other
39 case 305: // Use Proxy
40 case 307: // Temporary Redirect
41 case 308: // Permanent Redirect
42 6 return true;
43 3 default:
44 3 return false;
45 }
46 }
47
48 bool
49 6 is_retry( unsigned code ) noexcept
50 {
51
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 3 times.
6 switch( code )
52 {
53 3 case 502: // Bad Gateway
54 case 503: // Service Unavailable
55 case 504: // Gateway Timeout
56 3 return true;
57 3 default:
58 3 return false;
59 }
60 }
61
62 } // statuses
63 } // http
64 } // boost
65