Bitcoin Core
32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
src
test
system_ram_tests.cpp
Go to the documentation of this file.
1
// Copyright (c) 2025-present The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or https://opensource.org/license/mit/.
4
5
#include <
common/system.h
>
6
#include <
util/byte_units.h
>
7
8
#include <boost/test/unit_test.hpp>
9
10
BOOST_AUTO_TEST_SUITE
(
system_ram_tests
)
11
12
BOOST_AUTO_TEST_CASE
(
total_ram
)
13
{
14
const
auto
total{
TryGetTotalRam
()};
15
BOOST_REQUIRE
(total);
16
BOOST_CHECK_GE
(*total, 1
_GiB
);
17
BOOST_CHECK_LT
(*total, 10'000
_GiB
);
// ~10 TiB memory is unlikely
18
}
19
20
BOOST_AUTO_TEST_SUITE_END
()
BOOST_CHECK_LT
BOOST_CHECK_LT(ZeroL, OneL)
byte_units.h
TryGetTotalRam
std::optional< uint64_t > TryGetTotalRam()
Return the total RAM available on the current system, if detectable.
Definition
system.cpp:99
BOOST_AUTO_TEST_SUITE_END
BOOST_AUTO_TEST_SUITE_END()
system.h
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(total_ram)
Definition
system_ram_tests.cpp:12
Ticks
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition
time.h:82
Generated on Sat Oct 24 2026 20:00:31 for Bitcoin Core by
1.9.8