From 00aff5cfe064a5f54e79014785863d00fb23de0b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 12:06:39 +0100 Subject: [PATCH] style: clang-tidy auto fixes (#2107) Fixes #2106. Co-authored-by: godexsoft <385326+godexsoft@users.noreply.github.com> --- src/etl/LoadBalancer.cpp | 3 ++- tests/integration/data/cassandra/BackendTests.cpp | 6 +++--- tests/unit/data/cassandra/LedgerHeaderCacheTests.cpp | 8 +++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/etl/LoadBalancer.cpp b/src/etl/LoadBalancer.cpp index 826231f6..1769d277 100644 --- a/src/etl/LoadBalancer.cpp +++ b/src/etl/LoadBalancer.cpp @@ -36,6 +36,7 @@ #include "util/newconfig/ConfigDefinition.hpp" #include "util/newconfig/ObjectView.hpp" #include "util/prometheus/Label.hpp" +#include "util/prometheus/Prometheus.hpp" #include #include @@ -66,7 +67,7 @@ namespace etl { namespace { std::vector const kHISTOGRAM_BUCKETS{1, 2, 5, 10, 20, 50, 100, 200, 500, 700, 1000}; -} +} // namespace std::shared_ptr LoadBalancer::makeLoadBalancer( diff --git a/tests/integration/data/cassandra/BackendTests.cpp b/tests/integration/data/cassandra/BackendTests.cpp index 6931aec8..c7e39f48 100644 --- a/tests/integration/data/cassandra/BackendTests.cpp +++ b/tests/integration/data/cassandra/BackendTests.cpp @@ -1324,7 +1324,7 @@ TEST_F(CacheBackendCassandraTest, CacheFetchLedgerBySeq) { runSpawn([&](boost::asio::yield_context yield) { auto rawHeaderBlob = hexStringToBinaryString(kRAWHEADER); - ripple::LedgerHeader lgrInfo = util::deserializeHeader(ripple::makeSlice(rawHeaderBlob)); + ripple::LedgerHeader const lgrInfo = util::deserializeHeader(ripple::makeSlice(rawHeaderBlob)); backend_->writeLedger(lgrInfo, std::move(rawHeaderBlob)); auto const testLedgerSeq = lgrInfo.seq; @@ -1333,7 +1333,7 @@ TEST_F(CacheBackendCassandraTest, CacheFetchLedgerBySeq) EXPECT_CALL(getMockCache(), put(data::FetchLedgerCache::CacheEntry{lgrInfo, testLedgerSeq})); { - testing::InSequence s; + testing::InSequence const s; // first time, getSeq doesn't match ledger sequence EXPECT_CALL(getMockCache(), get()).WillOnce(testing::Return(std::nullopt)); @@ -1359,7 +1359,7 @@ TEST_F(CacheBackendCassandraTest, CacheFetchLedgerBySeq) } struct BackendCassandraNodeMessageTest : BackendCassandraTest { - boost::uuids::random_generator generateUuid; + boost::uuids::random_generator generateUuid{}; }; TEST_F(BackendCassandraNodeMessageTest, UpdateFetch) diff --git a/tests/unit/data/cassandra/LedgerHeaderCacheTests.cpp b/tests/unit/data/cassandra/LedgerHeaderCacheTests.cpp index 24e10a9f..145b05e3 100644 --- a/tests/unit/data/cassandra/LedgerHeaderCacheTests.cpp +++ b/tests/unit/data/cassandra/LedgerHeaderCacheTests.cpp @@ -21,8 +21,6 @@ #include "util/TestObject.hpp" #include -#include -#include using namespace data; using Test = ::testing::Test; @@ -44,7 +42,7 @@ TEST_F(FetchLedgerCacheTest, DefaultCacheIsEmpty) TEST_F(FetchLedgerCacheTest, CanStoreAndRetrieveEntry) { auto const ledger = createLedgerHeader(kLEDGER_HASH, 42); - FetchLedgerCache::CacheEntry entry{.ledger = ledger, .seq = 42}; + FetchLedgerCache::CacheEntry const entry{.ledger = ledger, .seq = 42}; cache_.put(entry); auto const result = cache_.get(); @@ -58,8 +56,8 @@ TEST_F(FetchLedgerCacheTest, PutOverwritesPreviousEntry) auto const ledger1 = createLedgerHeader(kLEDGER_HASH, 1); auto const ledger2 = createLedgerHeader(kLEDGER_HASH2, 2); - FetchLedgerCache::CacheEntry entry1{.ledger = ledger1, .seq = 1}; - FetchLedgerCache::CacheEntry entry2{.ledger = ledger2, .seq = 2}; + FetchLedgerCache::CacheEntry const entry1{.ledger = ledger1, .seq = 1}; + FetchLedgerCache::CacheEntry const entry2{.ledger = ledger2, .seq = 2}; cache_.put(entry1); cache_.put(entry2);