src/detail/except.cpp
20.0% Lines (4/20)
20.0% List of functions (2/10)
25.0% Branches (2/8)
Functions (10)
Function
Calls
Lines
Branches
Blocks
boost::capy::detail::throw_bad_typeid()
:21
0
0.0%
–
–
boost::capy::detail::throw_bad_alloc()
:27
0
0.0%
–
–
boost::capy::detail::throw_invalid_argument()
:33
0
100.0%
100.0%
–
boost::capy::detail::throw_invalid_argument(char const*)
:40
0
0.0%
0.0%
–
boost::capy::detail::throw_length_error()
:47
0
100.0%
100.0%
–
boost::capy::detail::throw_length_error(char const*)
:54
0
0.0%
0.0%
–
boost::capy::detail::throw_logic_error()
:61
0
0.0%
0.0%
–
boost::capy::detail::throw_out_of_range()
:68
0
0.0%
0.0%
–
boost::capy::detail::throw_runtime_error(char const*)
:74
0
0.0%
0.0%
–
boost::capy::detail::throw_system_error(std::error_code const&)
:81
0
0.0%
0.0%
–
| Line | Branch | TLA | Hits | Source Code |
|---|---|---|---|---|
| 1 | // | |||
| 2 | // Copyright (c) 2019 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/capy | |||
| 8 | // | |||
| 9 | ||||
| 10 | #include <boost/capy/detail/config.hpp> | |||
| 11 | #include <boost/capy/detail/except.hpp> | |||
| 12 | #include <system_error> | |||
| 13 | #include <stdexcept> | |||
| 14 | #include <typeinfo> | |||
| 15 | ||||
| 16 | namespace boost { | |||
| 17 | namespace capy { | |||
| 18 | namespace detail { | |||
| 19 | ||||
| 20 | void | |||
| 21 | ✗ | throw_bad_typeid() | ||
| 22 | { | |||
| 23 | ✗ | throw std::bad_typeid(); | ||
| 24 | } | |||
| 25 | ||||
| 26 | void | |||
| 27 | ✗ | throw_bad_alloc() | ||
| 28 | { | |||
| 29 | ✗ | throw std::bad_alloc(); | ||
| 30 | } | |||
| 31 | ||||
| 32 | void | |||
| 33 | 10x | throw_invalid_argument() | ||
| 34 | { | |||
| 35 | throw std::invalid_argument( | |||
| 36 |
1/1✓ Branch 2 taken 10 times.
|
10x | "invalid argument"); | |
| 37 | } | |||
| 38 | ||||
| 39 | void | |||
| 40 | ✗ | throw_invalid_argument( | ||
| 41 | char const* what) | |||
| 42 | { | |||
| 43 | ✗ | throw std::invalid_argument(what); | ||
| 44 | } | |||
| 45 | ||||
| 46 | void | |||
| 47 | 7x | throw_length_error() | ||
| 48 | { | |||
| 49 | throw std::length_error( | |||
| 50 |
1/1✓ Branch 2 taken 7 times.
|
7x | "length error"); | |
| 51 | } | |||
| 52 | ||||
| 53 | void | |||
| 54 | ✗ | throw_length_error( | ||
| 55 | char const* what) | |||
| 56 | { | |||
| 57 | ✗ | throw std::length_error(what); | ||
| 58 | } | |||
| 59 | ||||
| 60 | void | |||
| 61 | ✗ | throw_logic_error() | ||
| 62 | { | |||
| 63 | throw std::logic_error( | |||
| 64 | ✗ | "logic error"); | ||
| 65 | } | |||
| 66 | ||||
| 67 | void | |||
| 68 | ✗ | throw_out_of_range() | ||
| 69 | { | |||
| 70 | ✗ | throw std::out_of_range("out of range"); | ||
| 71 | } | |||
| 72 | ||||
| 73 | void | |||
| 74 | ✗ | throw_runtime_error( | ||
| 75 | char const* what) | |||
| 76 | { | |||
| 77 | ✗ | throw std::runtime_error(what); | ||
| 78 | } | |||
| 79 | ||||
| 80 | void | |||
| 81 | ✗ | throw_system_error( | ||
| 82 | std::error_code const& ec) | |||
| 83 | { | |||
| 84 | ✗ | throw std::system_error(ec); | ||
| 85 | } | |||
| 86 | ||||
| 87 | } // detail | |||
| 88 | } // capy | |||
| 89 | } // boost | |||
| 90 |