Skip to content

Commit cde9a4b

Browse files
committed
refactor: switch from CAutoFile to AutoFile
1 parent bbd4646 commit cde9a4b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/bench/load_external.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static void LoadExternalBlockFile(benchmark::Bench& bench)
5555
bench.run([&] {
5656
// "rb" is "binary, O_RDONLY", positioned to the start of the file.
5757
// The file will be closed by LoadExternalBlockFile().
58-
CAutoFile file{fsbridge::fopen(blkfile, "rb"), CLIENT_VERSION};
58+
AutoFile file{fsbridge::fopen(blkfile, "rb")};
5959
testing_setup->m_node.chainman->LoadExternalBlockFile(file, &pos, &blocks_with_unknown_parent);
6060
});
6161
fs::remove(blkfile);

src/bench/streams_findbyte.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
static void FindByte(benchmark::Bench& bench)
1515
{
1616
// Setup
17-
CAutoFile file{fsbridge::fopen("streams_tmp", "w+b"), 0};
17+
AutoFile file{fsbridge::fopen("streams_tmp", "w+b")};
1818
const size_t file_size = 200;
1919
uint8_t data[file_size] = {0};
2020
data[file_size-1] = 1;

src/test/streams_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ BOOST_AUTO_TEST_CASE(streams_serializedata_xor)
249249
BOOST_AUTO_TEST_CASE(streams_buffered_file)
250250
{
251251
fs::path streams_test_filename = m_args.GetDataDirBase() / "streams_test_tmp";
252-
CAutoFile file{fsbridge::fopen(streams_test_filename, "w+b"), 333};
252+
AutoFile file{fsbridge::fopen(streams_test_filename, "w+b")};
253253

254254
// The value at each offset is the offset.
255255
for (uint8_t j = 0; j < 40; ++j) {
@@ -380,7 +380,7 @@ BOOST_AUTO_TEST_CASE(streams_buffered_file)
380380
BOOST_AUTO_TEST_CASE(streams_buffered_file_skip)
381381
{
382382
fs::path streams_test_filename = m_args.GetDataDirBase() / "streams_test_tmp";
383-
CAutoFile file{fsbridge::fopen(streams_test_filename, "w+b"), 333};
383+
AutoFile file{fsbridge::fopen(streams_test_filename, "w+b")};
384384
// The value at each offset is the byte offset (e.g. byte 1 in the file has the value 0x01).
385385
for (uint8_t j = 0; j < 40; ++j) {
386386
file << j;
@@ -433,7 +433,7 @@ BOOST_AUTO_TEST_CASE(streams_buffered_file_rand)
433433

434434
fs::path streams_test_filename = m_args.GetDataDirBase() / "streams_test_tmp";
435435
for (int rep = 0; rep < 50; ++rep) {
436-
CAutoFile file{fsbridge::fopen(streams_test_filename, "w+b"), 333};
436+
AutoFile file{fsbridge::fopen(streams_test_filename, "w+b")};
437437
size_t fileSize = InsecureRandRange(256);
438438
for (uint8_t i = 0; i < fileSize; ++i) {
439439
file << i;

0 commit comments

Comments
 (0)