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:
Yury Fedorov 2022-12-19 15:03:11 +01:00 committed by GitHub
parent fe5a386b40
commit 62edc4fb00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -67,8 +67,8 @@ void BM_explicit_iteration_count(benchmark::State& state) {
// Test that the requested iteration count is respected.
assert(state.max_iterations == 42);
size_t actual_iterations = 0;
for (auto _ : state) ++actual_iterations;
for (auto _ : state) {
}
assert(state.iterations() == state.max_iterations);
assert(state.iterations() == 42);
}