include/boost/boost-ci/boost_ci.hpp
100.0% Lines (1/1)
100.0% Functions (1/1)
| Line | TLA | Hits | Source Code |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2020-2021 Alexander Grund | ||
| 3 | // | ||
| 4 | // Use, modification and distribution is subject to the Boost Software License, | ||
| 5 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | ||
| 6 | // http://www.boost.org/LICENSE_1_0.txt) | ||
| 7 | |||
| 8 | // Just something so we can test dependencies on other Boost libs | ||
| 9 | #include <boost/config.hpp> | ||
| 10 | #include <stdexcept> | ||
| 11 | #ifndef BOOST_NO_CXX11_SMART_PTR | ||
| 12 | #include <memory> | ||
| 13 | #endif | ||
| 14 | |||
| 15 | #ifdef BOOST_MSVC | ||
| 16 | #define MSVC_VALUE 1 | ||
| 17 | #else | ||
| 18 | #define MSVC_VALUE 0 | ||
| 19 | #endif | ||
| 20 | |||
| 21 | // This define is usually set in boost/<libname>/config.hpp | ||
| 22 | #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_BOOST_CI_DYN_LINK) | ||
| 23 | #ifdef BOOST_BOOST_CI_SOURCE | ||
| 24 | #define BOOST_BOOST_CI_DECL BOOST_SYMBOL_EXPORT | ||
| 25 | #else | ||
| 26 | #define BOOST_BOOST_CI_DECL BOOST_SYMBOL_IMPORT | ||
| 27 | #endif | ||
| 28 | #else | ||
| 29 | #define BOOST_BOOST_CI_DECL | ||
| 30 | #endif | ||
| 31 | |||
| 32 | namespace boost | ||
| 33 | { | ||
| 34 | namespace boost_ci | ||
| 35 | { | ||
| 36 | class BOOST_SYMBOL_VISIBLE example_error : public std::runtime_error { | ||
| 37 | public: | ||
| 38 | 1 | example_error() : std::runtime_error("Example error for demonstration") {} | |
| 39 | }; | ||
| 40 | |||
| 41 | // Some function to test. Returns 41 for 0, 42 for 1 and throws for other values | ||
| 42 | BOOST_BOOST_CI_DECL int get_answer(int isMsvc = MSVC_VALUE); | ||
| 43 | } | ||
| 44 | } | ||
| 45 |