src/corosio/src/error.cpp
85.7% Lines (6/7)
100.0% List of functions (2/2)
50.0% Branches (2/4)
Functions (2)
| Line | Branch | TLA | Hits | Source Code |
|---|---|---|---|---|
| 1 | // | |||
| 2 | // Copyright (c) 2026 Michael Vandeberg | |||
| 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/corosio | |||
| 8 | // | |||
| 9 | ||||
| 10 | #include <boost/corosio/error.hpp> | |||
| 11 | ||||
| 12 | namespace boost::corosio::detail { | |||
| 13 | ||||
| 14 | char const* | |||
| 15 | 1x | error_cat_type::name() const noexcept | ||
| 16 | { | |||
| 17 | 1x | return "boost.corosio"; | ||
| 18 | } | |||
| 19 | ||||
| 20 | std::string | |||
| 21 | 1x | error_cat_type::message(int ev) const | ||
| 22 | { | |||
| 23 |
1/2✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 8 not taken.
|
1x | switch (static_cast<error>(ev)) | |
| 24 | { | |||
| 25 | 1x | case error::already_open: | ||
| 26 |
1/1✓ Branch 5 → 6 taken 1 time.
|
2x | return "already open"; | |
| 27 | } | |||
| 28 | ✗ | return "unknown corosio error"; | ||
| 29 | } | |||
| 30 | ||||
| 31 | #if defined(__cpp_constinit) && __cpp_constinit >= 201907L | |||
| 32 | constinit error_cat_type error_cat; | |||
| 33 | #else | |||
| 34 | error_cat_type error_cat; | |||
| 35 | #endif | |||
| 36 | ||||
| 37 | } // namespace boost::corosio::detail | |||
| 38 |