MCPcopy Create free account
hub / github.com/chronoxor/CppBenchmark / FileFixture

Class FileFixture

examples/fwrite.cpp:13–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11const auto settings = CppBenchmark::Settings().ParamRange(chunk_size_from, chunk_size_to, [](int from, int to, int& result) { int r = result; result *= 2; return r; });
12
13class FileFixture
14{
15protected:
16 FILE* file;
17 std::array<uint8_t, chunk_size_to> buffer;
18
19 FileFixture() : file(nullptr), buffer()
20 {
21 // Open file for binary write
22 file = fopen("fwrite.out", "wb");
23 }
24
25 ~FileFixture()
26 {
27 // Close file
28 fclose(file);
29
30 // Delete file
31 remove("fwrite.out");
32 }
33};
34
35BENCHMARK_FIXTURE(FileFixture, "fwrite()", settings)
36{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected