fix(test): brace assertion bodies gcc reads as a dangling else

The gcc debug-coverage job rejected an unbraced `if` whose body is a GTest
assertion: EXPECT_EQ expands to an if/else, so the outer `if` leaves an else
that could bind either way, and -Werror=dangling-else refuses it. clang does
not warn, which is why only that one job failed.

Braced the span-names case that failed, then swept every test file this
branch touches for the same shape and braced the two others found, so the
next gcc run does not fail on the next one down the list.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Pratik Mankawde
2026-07-27 17:05:59 +01:00
parent 445e20f057
commit 6bfc25ddf9
3 changed files with 8 additions and 0 deletions

View File

@@ -465,8 +465,12 @@ TEST(LedgerSpanNames, phaseOutcome_covers_its_whole_input_domain)
// Whenever the budget expired, the answer is `timeout`
// regardless of the other two -- the precedence property, not
// just the four sampled points above.
// Braced deliberately: EXPECT_EQ expands to an if/else, so an
// unbraced if around it is a dangling else, which gcc rejects.
if (timedOut)
{
EXPECT_EQ(outcome, std::string_view(ledger_span::val::timeout));
}
}
}
}