trompeloeil.hpp (954B)
1 /* 2 * Trompeloeil C++ mocking framework 3 * 4 * Copyright Björn Fahller 2014-2019 5 * 6 * Use, modification and distribution is subject to the 7 * Boost Software License, Version 1.0. (See accompanying 8 * file LICENSE_1_0.txt or copy at 9 * http://www.boost.org/LICENSE_1_0.txt) 10 * 11 * Project home: https://github.com/rollbear/trompeloeil 12 */ 13 14 15 #ifndef TROMPELOEIL_BOOST_HPP_ 16 #define TROMPELOEIL_BOOST_HPP_ 17 18 #ifndef BOOST_TEST 19 #error "<boost/unit_test.hpp> must be included before <boost/trompeloeil.hpp>" 20 #endif 21 22 #include "../trompeloeil.hpp" 23 24 namespace trompeloeil 25 { 26 template <> 27 inline void reporter<specialized>::send( 28 severity s, 29 char const *file, 30 unsigned long line, 31 const char* msg) 32 { 33 std::ostringstream os; 34 if (line != 0U) os << file << ':' << line << '\n'; 35 auto text = os.str() + msg; 36 if (s == severity::fatal) 37 BOOST_FAIL(text); 38 else 39 BOOST_ERROR(text); 40 } 41 } 42 43 44 #endif //TROMPELOEIL_BOOST_HPP_