From fda0935bddbb2112cb7d496eca850231974310ae Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Thu, 27 Aug 2026 16:12:10 +0100 Subject: [PATCH] test(telemetry): compile the overlapping-insert round only with telemetry The round and its two constants are reached only from the write-stats tests, which are inside the telemetry guard. Left outside it, the round is an unused function in a build without telemetry, and -Werror rejects it on both gcc and clang. Moves the guard boundary rather than annotating the round, so the build without telemetry carries no dead code. Mirrors NuDBBackend::recordInsert on the production side, which is guarded for the same reason. --- src/tests/libxrpl/nodestore/NuDBFactory.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tests/libxrpl/nodestore/NuDBFactory.cpp b/src/tests/libxrpl/nodestore/NuDBFactory.cpp index 09d398fa14..33afe573da 100644 --- a/src/tests/libxrpl/nodestore/NuDBFactory.cpp +++ b/src/tests/libxrpl/nodestore/NuDBFactory.cpp @@ -61,6 +61,11 @@ runRoundTrip(Section const& params, std::size_t expectedBlocksize) EXPECT_EQ(batch, copy); } +// The round below and its two constants are used only by the write-stats tests, +// which are themselves compiled in with telemetry. Outside this guard the round +// is an unused function in a build without telemetry, which -Werror rejects. +#ifdef XRPL_ENABLE_TELEMETRY + /** * Threads used by the overlapping-insert round below. */ @@ -145,6 +150,8 @@ runOverlappingInsertRound(Backend& backend, int round) th.join(); } +#endif // XRPL_ENABLE_TELEMETRY + } // namespace TEST(NuDBFactory, default_block_size)