mirror of https://github.com/google/benchmark.git
Bug fix variable 'actual_iterations' set but not used (#1517)
* Bug fix variable 'actual_iterations' set but not used Compiling the project in clang 15 without -Wno-unused-but-set-variable flag the following error is generated: benchmark-src/test/options_test.cc:70:10: error: variable 'actual_iterations' set but not used [-Werror,-Wunused-but-set-variable] size_t actual_iterations = 0; ^ * Adjust according formatting of `clang-format` Co-authored-by: dominic hamon <510002+dmah42@users.noreply.github.com>
This commit is contained in:
parent
fe5a386b40
commit
62edc4fb00
|
@ -67,8 +67,8 @@ void BM_explicit_iteration_count(benchmark::State& state) {
|
||||||
|
|
||||||
// Test that the requested iteration count is respected.
|
// Test that the requested iteration count is respected.
|
||||||
assert(state.max_iterations == 42);
|
assert(state.max_iterations == 42);
|
||||||
size_t actual_iterations = 0;
|
for (auto _ : state) {
|
||||||
for (auto _ : state) ++actual_iterations;
|
}
|
||||||
assert(state.iterations() == state.max_iterations);
|
assert(state.iterations() == state.max_iterations);
|
||||||
assert(state.iterations() == 42);
|
assert(state.iterations() == 42);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue