LCOV - code coverage report
Current view: top level - cell - ExceptionWithLocation.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 10 10 100.0 %
Date: 2026-07-27 19:05:57 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #include "ExceptionWithLocation.hpp"
       2             : 
       3             : #include <sstream>
       4             : 
       5           7 : ExceptionWithLocation::ExceptionWithLocation(const std::string& description, const std::source_location location)
       6           7 :     : std::runtime_error(buildMessage(description, location))
       7             : {
       8           7 : }
       9             : 
      10           7 : std::string ExceptionWithLocation::buildMessage(const std::string& description,
      11             :                                                 [[maybe_unused]] const std::source_location& location)
      12             : {
      13           7 :     std::ostringstream oss;
      14           7 :     oss << "Error: " << description;
      15             : 
      16             : #ifdef DEBUG
      17          14 :     oss << "\nLine: " << fs::path(location.file_name()).filename().string() << ":" << location.line()
      18           7 :         << "\nFunction: " << location.function_name();
      19             : #endif
      20             : 
      21          14 :     return oss.str();
      22           7 : }

Generated by: LCOV version 1.14