aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2023-11-15 13:10:13 +1000
committerAnthony Towns <aj@erisian.com.au>2023-11-18 03:01:41 +1000
commitcde9a4b137e93f1548dffac9b396ca0b472b6187 (patch)
treef7b8e845724fe2a0a3f22a13c6d7b0c992bb8b34 /src
parentbbd4646a2ef514c31570ca9d1475fc9ddb35bdfd (diff)
refactor: switch from CAutoFile to AutoFile
Diffstat (limited to 'src')
-rw-r--r--src/bench/load_external.cpp2
-rw-r--r--src/bench/streams_findbyte.cpp2
-rw-r--r--src/test/streams_tests.cpp6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/bench/load_external.cpp b/src/bench/load_external.cpp
index 3b100d97b0..fba1233901 100644
--- a/src/bench/load_external.cpp
+++ b/src/bench/load_external.cpp
@@ -55,7 +55,7 @@ static void LoadExternalBlockFile(benchmark::Bench& bench)
bench.run([&] {
// "rb" is "binary, O_RDONLY", positioned to the start of the file.
// The file will be closed by LoadExternalBlockFile().
- CAutoFile file{fsbridge::fopen(blkfile, "rb"), CLIENT_VERSION};
+ AutoFile file{fsbridge::fopen(blkfile, "rb")};
testing_setup->m_node.chainman->LoadExternalBlockFile(file, &pos, &blocks_with_unknown_parent);
});
fs::remove(blkfile);
diff --git a/src/bench/streams_findbyte.cpp b/src/bench/streams_findbyte.cpp
index 4aaccb2af8..5098262e9a 100644
--- a/src/bench/streams_findbyte.cpp
+++ b/src/bench/streams_findbyte.cpp
@@ -14,7 +14,7 @@
static void FindByte(benchmark::Bench& bench)
{
// Setup
- CAutoFile file{fsbridge::fopen("streams_tmp", "w+b"), 0};
+ AutoFile file{fsbridge::fopen("streams_tmp", "w+b")};
const size_t file_size = 200;
uint8_t data[file_size] = {0};
data[file_size-1] = 1;
diff --git a/src/test/streams_tests.cpp b/src/test/streams_tests.cpp
index 38fdc7a6e9..d8478ecf5f 100644
--- a/src/test/streams_tests.cpp
+++ b/src/test/streams_tests.cpp
@@ -249,7 +249,7 @@ BOOST_AUTO_TEST_CASE(streams_serializedata_xor)
BOOST_AUTO_TEST_CASE(streams_buffered_file)
{
fs::path streams_test_filename = m_args.GetDataDirBase() / "streams_test_tmp";
- CAutoFile file{fsbridge::fopen(streams_test_filename, "w+b"), 333};
+ AutoFile file{fsbridge::fopen(streams_test_filename, "w+b")};
// The value at each offset is the offset.
for (uint8_t j = 0; j < 40; ++j) {
@@ -380,7 +380,7 @@ BOOST_AUTO_TEST_CASE(streams_buffered_file)
BOOST_AUTO_TEST_CASE(streams_buffered_file_skip)
{
fs::path streams_test_filename = m_args.GetDataDirBase() / "streams_test_tmp";
- CAutoFile file{fsbridge::fopen(streams_test_filename, "w+b"), 333};
+ AutoFile file{fsbridge::fopen(streams_test_filename, "w+b")};
// The value at each offset is the byte offset (e.g. byte 1 in the file has the value 0x01).
for (uint8_t j = 0; j < 40; ++j) {
file << j;
@@ -433,7 +433,7 @@ BOOST_AUTO_TEST_CASE(streams_buffered_file_rand)
fs::path streams_test_filename = m_args.GetDataDirBase() / "streams_test_tmp";
for (int rep = 0; rep < 50; ++rep) {
- CAutoFile file{fsbridge::fopen(streams_test_filename, "w+b"), 333};
+ AutoFile file{fsbridge::fopen(streams_test_filename, "w+b")};
size_t fileSize = InsecureRandRange(256);
for (uint8_t i = 0; i < fileSize; ++i) {
file << i;