Bitcoin Core
32.1.0
P2P Digital Currency
Toggle main menu visibility
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:108
BOOST_AUTO_TEST_SUITE_END
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(ipc_tests)
Definition
ipc_tests.cpp:202
system.h
Generated on
for Bitcoin Core by
1.18.0