LCOV - code coverage report
Current view: top level - src/node - connection_types.cpp (source / functions) Coverage Total Hit
Test: total_coverage.info Lines: 84.6 % 26 22
Test Date: 2026-01-16 05:29:45 Functions: 100.0 % 2 2
Branches: 75.0 % 12 9

             Branch data     Line data    Source code
       1                 :             : // Copyright (c) 2022-present 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                 :       15085 : std::string ConnectionTypeAsString(ConnectionType conn_type)
       9                 :             : {
      10   [ +  +  -  +  :       15085 :     switch (conn_type) {
             +  +  +  - ]
      11                 :        9179 :     case ConnectionType::INBOUND:
      12                 :        9179 :         return "inbound";
      13                 :        5011 :     case ConnectionType::MANUAL:
      14                 :        5011 :         return "manual";
      15                 :           0 :     case ConnectionType::FEELER:
      16                 :           0 :         return "feeler";
      17                 :         804 :     case ConnectionType::OUTBOUND_FULL_RELAY:
      18                 :         804 :         return "outbound-full-relay";
      19                 :          70 :     case ConnectionType::BLOCK_RELAY:
      20                 :          70 :         return "block-relay-only";
      21                 :          11 :     case ConnectionType::ADDR_FETCH:
      22                 :          11 :         return "addr-fetch";
      23                 :          10 :     case ConnectionType::PRIVATE_BROADCAST:
      24                 :          10 :         return "private-broadcast";
      25                 :             :     } // no default case, so the compiler can warn about missing cases
      26                 :             : 
      27                 :           0 :     assert(false);
      28                 :             : }
      29                 :             : 
      30                 :       15070 : std::string TransportTypeAsString(TransportProtocolType transport_type)
      31                 :             : {
      32   [ +  +  +  - ]:       15070 :     switch (transport_type) {
      33                 :          70 :     case TransportProtocolType::DETECTING:
      34                 :          70 :         return "detecting";
      35                 :       13243 :     case TransportProtocolType::V1:
      36                 :       13243 :         return "v1";
      37                 :        1757 :     case TransportProtocolType::V2:
      38                 :        1757 :         return "v2";
      39                 :             :     } // no default case, so the compiler can warn about missing cases
      40                 :             : 
      41                 :           0 :     assert(false);
      42                 :             : }
        

Generated by: LCOV version 2.0-1