fix(tests): Brace the EXPECT inside an if in the tx account key test

gtest's EXPECT_EQ expands to an if/else, so an unbraced if around it is a
dangling-else error with warnings treated as errors. Found by the local
build of xrpl_tests.
This commit is contained in:
Pratik Mankawde
2026-09-23 18:30:52 +01:00
parent dd8a35ec36
commit 010fe0c7c9

View File

@@ -85,8 +85,12 @@ TEST(TxAccountSpanNames, account_fields_no_transaction_carries_have_no_key)
for (auto const* field : all)
{
// Braced on purpose: EXPECT_EQ expands to an if/else, so an unbraced
// if around it is a dangling-else error with warnings as errors.
if (!carried.contains(field))
{
EXPECT_EQ(accountFieldAttributeKey(*field), std::nullopt) << field->getName();
}
}
}