trompeloeil

FORK: Header only C++14 mocking framework
git clone https://git.neptards.moe/u3shit/trompeloeil.git
Log | Files | Refs | README

trompeloeil.hpp (1178B)


      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_CRPCUT_HPP_
     16 #define TROMPELOEIL_CRPCUT_HPP_
     17 
     18 #ifndef CRPCUT_HERE
     19 #error "<crpcut.hpp> must be included before <crpcut/trompeloeil.hpp>"
     20 #endif
     21 
     22 #include "../trompeloeil.hpp"
     23 
     24 namespace trompeloeil
     25 {
     26   template <>
     27   inline void reporter<specialized>::send(
     28     severity,
     29     char const *file,
     30     unsigned long line,
     31     const char* msg)
     32   {
     33     std::ostringstream os;
     34     os << file << ':' << line;
     35     auto loc = os.str();
     36     auto location = line == 0U
     37                     ? ::crpcut::crpcut_test_monitor::current_test()->get_location()
     38                     : ::crpcut::datatypes::fixed_string::make(loc.c_str(), loc.length());
     39     ::crpcut::comm::report(::crpcut::comm::exit_fail,
     40                            std::ostringstream(msg),
     41                            location);
     42   }
     43 }
     44 
     45 
     46 #endif //TROMPELOEIL_CRPCUT_HPP_