• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

libbitcoin / libbitcoin-system / 41739337421

03 Nov 2026 11:27PM UTC coverage: 96.274% (-0.6%) from 96.843%
41739337421

push

github

web-flow
Merge pull request #2151 from evoskuil/master

Stop reading on reader failure, export instantiations only for windows libs.

11 of 11 new or added lines in 5 files covered. (100.0%)

302 existing lines in 67 files now uncovered.

26460 of 27484 relevant lines covered (96.27%)

4041533.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/src/data/data_chunk.cpp
1
/**
2
 * Copyright (c) 2011-2026 libbitcoin developers
3
 *
4
 * This file is part of libbitcoin.
5
 *
6
 * This program is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU Affero General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU Affero General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Affero General Public License
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 */
19
#include <bitcoin/system/data/data_chunk.hpp>
20

21
#include <bitcoin/system/data/data_slice.hpp>
22

23
namespace libbitcoin {
24
namespace system {
25

26
data_chunk to_chunk(uint8_t byte) NOEXCEPT
10 ✔
27
{
28
    return { byte };
10 ✔
29
}
30

31
data_chunk to_chunk(const data_slice& bytes) NOEXCEPT
14,777 ✔
32
{
33
    return bytes.to_chunk();
14,777 ✔
34
}
35

36
data_chunk build_chunk(const data_loaf& slices, size_t extra_reserve) NOEXCEPT
86 ✔
37
{
38
    size_t size = 0;
39
    for (const auto& slice: slices)
475 ✔
40
        size += slice.size();
389 ✔
41

42
    data_chunk out;
86 ✔
43
    out.reserve(size + extra_reserve);
86 ✔
44

45
    for (const auto& slice: slices)
475 ✔
46
        out.insert(out.cend(), slice.begin(), slice.end());
389 ✔
47

48
    return out;
86 ✔
UNCOV
49
}
×
50

51
data_chunk splice(const data_slice& left, const data_slice& right) NOEXCEPT
1,900,945 ✔
52
{
53
    data_chunk out(left.size() + right.size());
1,900,945 ✔
54
    std::copy(right.begin(), right.end(),
1,900,945 ✔
55
        std::copy(left.begin(), left.end(), out.begin()));
56

57
    return out;
1,900,945 ✔
58
}
59

60
} // namespace system
61
} // namespace libbitcoin
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc