You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Copyright (c) 2025-present The Bitcoin Core developers
2
+
// Distributed under the MIT software license, see the accompanying
3
+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
+
//
5
+
6
+
#include<common/system.h>
7
+
#include<test/util/setup_common.h>
8
+
9
+
#include<boost/test/unit_test.hpp>
10
+
11
+
#include<cstdint>
12
+
#include<optional>
13
+
14
+
BOOST_AUTO_TEST_SUITE(system_ram_tests)
15
+
16
+
BOOST_AUTO_TEST_CASE(total_ram)
17
+
{
18
+
constauto total{GetTotalRAM()};
19
+
if (!total) {
20
+
BOOST_WARN_MESSAGE(false, "skipping total_ram: total RAM unknown");
21
+
return;
22
+
}
23
+
24
+
BOOST_CHECK_GE(*total, 1000_MiB);
25
+
26
+
ifconstexpr (SIZE_MAX == UINT64_MAX) {
27
+
// Upper bound check only on 64-bit: 32-bit systems can reasonably have max memory,
28
+
// but extremely large values on 64-bit likely indicate detection errors
29
+
BOOST_CHECK_LT(*total, 10'000'000_MiB); // >10 TiB memory is unlikely
0 commit comments