LCOV - code coverage report
Current view: top level - src/node - connection_types.cpp (source / functions) Coverage Total Hit
Test: total_coverage.info Lines: 83.3 % 24 20
Test Date: 2024-08-28 05:13:07 Functions: 100.0 % 2 2
Branches: 72.7 % 11 8

             Branch data     Line data    Source code
       1                 :             : // Copyright (c) 2022 The Bitcoin Core developers
       2                 :             : // Distributed under the MIT software license, see the accompanying
       3                 :             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4                 :             : 
       5                 :             : #include <node/connection_types.h>
       6                 :             : #include <cassert>
       7                 :             : 
       8                 :       17420 : std::string ConnectionTypeAsString(ConnectionType conn_type)
       9                 :             : {
      10   [ +  +  -  +  :       17420 :     switch (conn_type) {
                +  +  - ]
      11                 :        9159 :     case ConnectionType::INBOUND:
      12                 :        9159 :         return "inbound";
      13                 :        7865 :     case ConnectionType::MANUAL:
      14                 :        7865 :         return "manual";
      15                 :           0 :     case ConnectionType::FEELER:
      16                 :           0 :         return "feeler";
      17                 :         318 :     case ConnectionType::OUTBOUND_FULL_RELAY:
      18                 :         318 :         return "outbound-full-relay";
      19                 :          67 :     case ConnectionType::BLOCK_RELAY:
      20                 :          67 :         return "block-relay-only";
      21                 :          11 :     case ConnectionType::ADDR_FETCH:
      22                 :          11 :         return "addr-fetch";
      23                 :             :     } // no default case, so the compiler can warn about missing cases
      24                 :             : 
      25                 :           0 :     assert(false);
      26                 :             : }
      27                 :             : 
      28                 :       17405 : std::string TransportTypeAsString(TransportProtocolType transport_type)
      29                 :             : {
      30   [ +  +  +  - ]:       17405 :     switch (transport_type) {
      31                 :          68 :     case TransportProtocolType::DETECTING:
      32                 :          68 :         return "detecting";
      33                 :       15505 :     case TransportProtocolType::V1:
      34                 :       15505 :         return "v1";
      35                 :        1832 :     case TransportProtocolType::V2:
      36                 :        1832 :         return "v2";
      37                 :             :     } // no default case, so the compiler can warn about missing cases
      38                 :             : 
      39                 :           0 :     assert(false);
      40                 :             : }
        

Generated by: LCOV version 2.0-1