From 8cd99e17e908cabe4f8b6209f17c58c5f7832783 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 15 Sep 2026 11:24:21 +0100 Subject: [PATCH] fix(test): compare SecretKey by bytes and drop an include CI flags SecretKey deletes operator==, so EXPECT_EQ on the pair's second member does not compile; compare the byte ranges instead. Application.cpp no longer calls logicError(), so clang-tidy's include-cleaner rejects there. Co-Authored-By: Claude Fable 5.1 --- src/tests/libxrpl/server/NodeIdentity.cpp | 7 ++++--- src/xrpld/app/main/Application.cpp | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/libxrpl/server/NodeIdentity.cpp b/src/tests/libxrpl/server/NodeIdentity.cpp index 086b63bbcf..6c5d1341f3 100644 --- a/src/tests/libxrpl/server/NodeIdentity.cpp +++ b/src/tests/libxrpl/server/NodeIdentity.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -109,7 +110,7 @@ TEST(WalletNodeIdentity, store_then_read_returns_the_same_pair) auto const stored = readNodeIdentity(*db); ASSERT_TRUE(stored.has_value()); EXPECT_EQ(stored->first, minted.first); - EXPECT_EQ(stored->second, minted.second); + EXPECT_TRUE(std::ranges::equal(stored->second, minted.second)); } TEST(WalletNodeIdentity, store_appends_rather_than_replacing) @@ -159,7 +160,7 @@ TEST(WalletNodeIdentity, clear_then_store_installs_the_new_pair) auto const stored = readNodeIdentity(*db); ASSERT_TRUE(stored.has_value()); EXPECT_EQ(stored->first, replacement.first); - EXPECT_EQ(stored->second, replacement.second); + EXPECT_TRUE(std::ranges::equal(stored->second, replacement.second)); } TEST(WalletNodeIdentity, get_mints_and_persists_when_the_table_is_empty) @@ -341,7 +342,7 @@ TEST(SelectNodeIdentity, returns_stored_when_reader_has_one) EXPECT_TRUE(reader.called); EXPECT_EQ(result.first, storedPair.first); - EXPECT_EQ(result.second, storedPair.second); + EXPECT_TRUE(std::ranges::equal(result.second, storedPair.second)); } TEST(SelectNodeIdentity, mints_when_nothing_stored) diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 13afb18c1d..aedaa14290 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include