From 010fe0c7c9977d7520c7dafc3f96a8495d21917c Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Wed, 23 Sep 2026 18:30:52 +0100 Subject: [PATCH] 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. --- src/tests/libxrpl/telemetry/TxAccountSpanNames.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tests/libxrpl/telemetry/TxAccountSpanNames.cpp b/src/tests/libxrpl/telemetry/TxAccountSpanNames.cpp index 0b51776647..7bfc6bab81 100644 --- a/src/tests/libxrpl/telemetry/TxAccountSpanNames.cpp +++ b/src/tests/libxrpl/telemetry/TxAccountSpanNames.cpp @@ -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(); + } } }