File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 3
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
4
5
5
#include < bench/bench.h>
6
-
7
6
#include < streams.h>
7
+ #include < test/util/setup_common.h>
8
8
#include < util/fs.h>
9
9
10
10
#include < cstddef>
13
13
14
14
static void FindByte (benchmark::Bench& bench)
15
15
{
16
- // Setup
17
- AutoFile file{fsbridge::fopen (" streams_tmp" , " w+b" )};
16
+ const auto testing_setup{MakeNoLogFileContext< const BasicTestingSetup>(ChainType::REGTEST)};
17
+ AutoFile file{fsbridge::fopen (testing_setup-> m_path_root / " streams_tmp" , " w+b" )};
18
18
const size_t file_size = 200 ;
19
19
uint8_t data[file_size] = {0 };
20
- data[file_size- 1 ] = 1 ;
20
+ data[file_size - 1 ] = 1 ;
21
21
file << data;
22
22
file.seek (0 , SEEK_SET);
23
23
BufferedFile bf{file, /* nBufSize=*/ file_size + 1 , /* nRewindIn=*/ file_size};
@@ -27,9 +27,7 @@ static void FindByte(benchmark::Bench& bench)
27
27
bf.FindByte (std::byte (1 ));
28
28
});
29
29
30
- // Cleanup
31
30
assert (file.fclose () == 0 );
32
- fs::remove (" streams_tmp" );
33
31
}
34
32
35
33
BENCHMARK (FindByte, benchmark::PriorityLevel::HIGH);
You can’t perform that action at this time.
0 commit comments