Branch data Line data Source code
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 [ + - + - : 7 : BOOST_AUTO_TEST_CASE(total_ram)
+ - + - -
+ + - + -
+ - + - +
- - + + -
+ - + - +
- + - - +
+ - + - +
- + - + -
- + + - +
- + - + -
+ - - + +
- ]
13 : : {
14 : 1 : const auto total{TryGetTotalRam()};
15 [ + - ]: 2 : BOOST_REQUIRE(total);
16 [ + - ]: 1 : BOOST_CHECK_GE(*total, 1_GiB);
17 [ + - ]: 1 : BOOST_CHECK_LT(*total, 10'000_GiB); // ~10 TiB memory is unlikely
18 : 1 : }
19 : :
20 : : BOOST_AUTO_TEST_SUITE_END()
|