aboutsummaryrefslogtreecommitdiff
path: root/test/skip_with_error_test.cc
diff options
context:
space:
mode:
authordominc8 <kormandominik@gmail.com>2021-12-06 12:18:04 +0100
committerGitHub <noreply@github.com>2021-12-06 11:18:04 +0000
commitab867074da2423c2d9cf225233191a01f043485d (patch)
treebd5800580a41b67cd46b45a24d965778e7cc1508 /test/skip_with_error_test.cc
parentfd258bbd131552beb2483b960a5e4b69553fdacf (diff)
downloadgoogle-benchmark-ab867074da2423c2d9cf225233191a01f043485d.tar.gz
clang-tidy: readability-redundant and performance (#1298)
* clang-tidy: readability-redundant-* * clang-tidy: performance-*
Diffstat (limited to 'test/skip_with_error_test.cc')
-rw-r--r--test/skip_with_error_test.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/skip_with_error_test.cc b/test/skip_with_error_test.cc
index 5e9700d..026d479 100644
--- a/test/skip_with_error_test.cc
+++ b/test/skip_with_error_test.cc
@@ -119,12 +119,13 @@ ADD_CASES("BM_error_during_running", {{"/1/threads:1", true, "error message"},
void BM_error_during_running_ranged_for(benchmark::State& state) {
assert(state.max_iterations > 3 && "test requires at least a few iterations");
- [[maybe_unused]] bool first_iter = true;
+ bool first_iter = true;
// NOTE: Users should not write the for loop explicitly.
for (auto It = state.begin(), End = state.end(); It != End; ++It) {
if (state.range(0) == 1) {
assert(first_iter);
first_iter = false;
+ (void)first_iter;
state.SkipWithError("error message");
// Test the unfortunate but documented behavior that the ranged-for loop
// doesn't automatically terminate when SkipWithError is set.