v29.4-roots.1 · Commit 2: [PATCH 02/13] runtime: preserve shared operator controls
src/test/system_ram_tests.cpp
Before: /dev/null · After: src/test/system_ram_tests.cpp
File metadata
new file mode 100644 index 0000000000000000000000000000000000000000..441a2012926d4e40fe78a995a2f88d07ff3f3c4e
Download original patch · Release notes
Diff rows 1–22 of 22. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
src/test/system_ram_tests.cpp
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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_ram.h>
|
|
6
|
+
#include <test/util/setup_common.h>
|
|
7
|
+
|
|
8
|
+
#include <boost/test/unit_test.hpp>
|
|
9
|
+
|
|
10
|
+
#include <cstdint>
|
|
11
|
+
#include <optional>
|
|
12
|
+
|
|
13
|
+
BOOST_AUTO_TEST_SUITE(system_ram_tests)
|
|
14
|
+
|
|
15
|
+
BOOST_AUTO_TEST_CASE(total_ram)
|
|
16
|
+
{
|
|
17
|
+
const auto total{*Assert(TryGetTotalRam())};
|
|
18
|
+
BOOST_CHECK_GE(total, 1_GiB);
|
|
19
|
+
BOOST_CHECK_LT(total, 10'000_GiB); // ~10 TiB memory is unlikely
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
BOOST_AUTO_TEST_SUITE_END()
|