diff --git a/src/bench/streams_findbyte.cpp b/src/bench/streams_findbyte.cpp index c2bb3c3a310..1f6f4d44494 100644 --- a/src/bench/streams_findbyte.cpp +++ b/src/bench/streams_findbyte.cpp @@ -3,8 +3,8 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include - #include +#include #include #include @@ -13,11 +13,11 @@ static void FindByte(benchmark::Bench& bench) { - // Setup - AutoFile file{fsbridge::fopen("streams_tmp", "w+b")}; + const auto testing_setup{MakeNoLogFileContext(ChainType::REGTEST)}; + AutoFile file{fsbridge::fopen(testing_setup->m_path_root / "streams_tmp", "w+b")}; const size_t file_size = 200; uint8_t data[file_size] = {0}; - data[file_size-1] = 1; + data[file_size - 1] = 1; file << data; file.seek(0, SEEK_SET); BufferedFile bf{file, /*nBufSize=*/file_size + 1, /*nRewindIn=*/file_size}; @@ -27,9 +27,7 @@ static void FindByte(benchmark::Bench& bench) bf.FindByte(std::byte(1)); }); - // Cleanup assert(file.fclose() == 0); - fs::remove("streams_tmp"); } BENCHMARK(FindByte, benchmark::PriorityLevel::HIGH);