LCOV - code coverage report
Current view: top level - src/bcrypt - error.cpp (source / functions) Coverage Total Hit Missed
Test: coverage_remapped.info Lines: 72.7 % 11 8 3
Test Date: 2026-06-13 19:44:58 Functions: 100.0 % 3 3

           TLA  Line data    Source code
       1                 : //
       2                 : // Copyright (c) 2025 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/http
       8                 : //
       9                 : 
      10                 : #include <boost/http/bcrypt.hpp>
      11                 : 
      12                 : namespace boost {
      13                 : namespace http {
      14                 : namespace bcrypt {
      15                 : namespace detail {
      16                 : 
      17                 : const char*
      18 HIT           2 : error_cat_type::
      19                 : name() const noexcept
      20                 : {
      21               2 :     return "boost.http.bcrypt";
      22                 : }
      23                 : 
      24                 : std::string
      25               4 : error_cat_type::
      26                 : message(int ev) const
      27                 : {
      28               8 :     return message(ev, nullptr, 0);
      29                 : }
      30                 : 
      31                 : char const*
      32               4 : error_cat_type::
      33                 : message(
      34                 :     int ev,
      35                 :     char*,
      36                 :     std::size_t) const noexcept
      37                 : {
      38               4 :     switch(static_cast<error>(ev))
      39                 :     {
      40 MIS           0 :     case error::ok: return "success";
      41 HIT           1 :     case error::invalid_salt: return "invalid salt";
      42               3 :     case error::invalid_hash: return "invalid hash";
      43 MIS           0 :     default:
      44               0 :         return "unknown";
      45                 :     }
      46                 : }
      47                 : 
      48                 : #if defined(__cpp_constinit) && __cpp_constinit >= 201907L
      49                 : constinit error_cat_type error_cat;
      50                 : #else
      51                 : error_cat_type error_cat;
      52                 : #endif
      53                 : 
      54                 : } // detail
      55                 : } // bcrypt
      56                 : } // http
      57                 : } // boost
        

Generated by: LCOV version 2.3