Coverage Report

Created: 2025-06-10 13:21

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/bitcoin/src/uint256.cpp
Line
Count
Source
1
// Copyright (c) 2009-2010 Satoshi Nakamoto
2
// Copyright (c) 2009-2020 The Bitcoin Core developers
3
// Distributed under the MIT software license, see the accompanying
4
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6
#include <uint256.h>
7
8
#include <util/strencodings.h>
9
10
template <unsigned int BITS>
11
std::string base_blob<BITS>::GetHex() const
12
38.3M
{
13
38.3M
    uint8_t m_data_rev[WIDTH];
14
1.26G
    for (int i = 0; i < WIDTH; ++i) {
  Branch (14:21): [True: 0, False: 0]
  Branch (14:21): [True: 1.22G, False: 38.3M]
15
1.22G
        m_data_rev[i] = m_data[WIDTH - 1 - i];
16
1.22G
    }
17
38.3M
    return HexStr(m_data_rev);
18
38.3M
}
Unexecuted instantiation: base_blob<160u>::GetHex[abi:cxx11]() const
base_blob<256u>::GetHex[abi:cxx11]() const
Line
Count
Source
12
38.3M
{
13
38.3M
    uint8_t m_data_rev[WIDTH];
14
1.26G
    for (int i = 0; i < WIDTH; ++i) {
  Branch (14:21): [True: 1.22G, False: 38.3M]
15
1.22G
        m_data_rev[i] = m_data[WIDTH - 1 - i];
16
1.22G
    }
17
38.3M
    return HexStr(m_data_rev);
18
38.3M
}
19
20
template <unsigned int BITS>
21
std::string base_blob<BITS>::ToString() const
22
38.1M
{
23
38.1M
    return (GetHex());
24
38.1M
}
Unexecuted instantiation: base_blob<160u>::ToString[abi:cxx11]() const
base_blob<256u>::ToString[abi:cxx11]() const
Line
Count
Source
22
38.1M
{
23
38.1M
    return (GetHex());
24
38.1M
}
25
26
// Explicit instantiations for base_blob<160>
27
template std::string base_blob<160>::GetHex() const;
28
template std::string base_blob<160>::ToString() const;
29
30
// Explicit instantiations for base_blob<256>
31
template std::string base_blob<256>::GetHex() const;
32
template std::string base_blob<256>::ToString() const;
33
34
const uint256 uint256::ZERO(0);
35
const uint256 uint256::ONE(1);