From a0c306614039ba63d67249ee0fab192afb93792e Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Wed, 23 Sep 2026 19:04:28 +0100 Subject: [PATCH 1/2] style: Rename gtest test cases to snake_case develop's new fix-gtest-names pre-commit hook requires a snake_case test-case name. CI runs it with --all-files, so the existing CamelCase names fail the check on every branch that carries this file. --- src/tests/libxrpl/telemetry/SpanGuardScope.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/tests/libxrpl/telemetry/SpanGuardScope.cpp b/src/tests/libxrpl/telemetry/SpanGuardScope.cpp index f05139410a..03c00e651a 100644 --- a/src/tests/libxrpl/telemetry/SpanGuardScope.cpp +++ b/src/tests/libxrpl/telemetry/SpanGuardScope.cpp @@ -315,7 +315,7 @@ protected: }; // freshRoot() must ignore the ambient active span and start a brand-new trace. -TEST_F(SpanGuardScopeTest, spanGuard_freshRoot_is_true_root_ignoring_ambient) +TEST_F(SpanGuardScopeTest, span_guard_fresh_root_is_true_root_ignoring_ambient) { { // Ambient span becomes the active span on this thread. @@ -345,7 +345,7 @@ TEST_F(SpanGuardScopeTest, spanGuard_freshRoot_is_true_root_ignoring_ambient) // A ScopedSpanGuard is the ambient active span on its thread the moment it is // constructed: a child created while it is alive parents to its span. -TEST_F(SpanGuardScopeTest, scopedGuard_is_ambient_on_construct) +TEST_F(SpanGuardScopeTest, scoped_guard_is_ambient_on_construct) { opentelemetry::trace::SpanId activeId; { @@ -382,7 +382,7 @@ TEST_F(SpanGuardScopeTest, scopedGuard_is_ambient_on_construct) // operator SpanGuard() && pops the Scope eagerly on the origin thread, so the // span is no longer ambient here and the resulting thread-free guard can be // ended on a worker thread without corrupting this thread's context stack. -TEST_F(SpanGuardScopeTest, scopedGuard_conversion_pops_scope_on_this_thread) +TEST_F(SpanGuardScopeTest, scoped_guard_conversion_pops_scope_on_this_thread) { { ScopedSpanGuard s(TraceCategory::Ledger, "ledger", "build"); @@ -425,7 +425,7 @@ TEST_F(SpanGuardScopeTest, scopedGuard_conversion_pops_scope_on_this_thread) // The SpanGuard produced by the conversion ends the span exactly once: the // moved-from ScopedSpanGuard must not re-end it on destruction. -TEST_F(SpanGuardScopeTest, scopedGuard_conversion_result_ends_span_once) +TEST_F(SpanGuardScopeTest, scoped_guard_conversion_result_ends_span_once) { { ScopedSpanGuard scoped(TraceCategory::Ledger, "ledger", "build"); @@ -458,7 +458,7 @@ TEST_F(SpanGuardScopeTest, scopedGuard_conversion_result_ends_span_once) // stack ignores the LocalValue swap, so the span would stay visible off-store // (the EXPECT_NE below would fail). Passes only because the fixture installs the // coro-aware storage that binds the ambient stack to the active store. -TEST_F(SpanGuardScopeTest, scopedGuard_survives_localvalue_store_swap) +TEST_F(SpanGuardScopeTest, scoped_guard_survives_localvalue_store_swap) { namespace ctx = opentelemetry::context; namespace trc = opentelemetry::trace; @@ -562,7 +562,7 @@ TEST_F(SpanGuardScopeTest, activate_sets_ambient_without_owning) // A forced-root span started while a PendingTraceId is active adopts that // pinned 16-byte trace_id and remains a true root (no parent). -TEST_F(SpanGuardScopeTest, deterministicIdGenerator_forced_root_gets_pending_trace_id) +TEST_F(SpanGuardScopeTest, deterministic_id_generator_forced_root_gets_pending_trace_id) { auto const h = makeTraceIdBytes(); { @@ -583,7 +583,7 @@ TEST_F(SpanGuardScopeTest, deterministicIdGenerator_forced_root_gets_pending_tra // A forced-root span with NO PendingTraceId gets a random (non-zero) trace_id, // never the deterministic hash -- the safety property when no id is pinned. -TEST_F(SpanGuardScopeTest, deterministicIdGenerator_no_pending_gives_random_root) +TEST_F(SpanGuardScopeTest, deterministic_id_generator_no_pending_gives_random_root) { auto const h = makeTraceIdBytes(); { @@ -607,7 +607,7 @@ TEST_F(SpanGuardScopeTest, deterministicIdGenerator_no_pending_gives_random_root // child, so the pinned id stays available -- proven here by a trailing // forced-root span that DOES adopt it (which also consumes the id so // ~PendingTraceId's consumed-assert holds; see the report for this choice). -TEST_F(SpanGuardScopeTest, deterministicIdGenerator_ambient_child_ignores_pending) +TEST_F(SpanGuardScopeTest, deterministic_id_generator_ambient_child_ignores_pending) { auto const h = makeTraceIdBytes(); { @@ -680,7 +680,7 @@ TEST_F(SpanGuardScopeTest, deterministicIdGenerator_ambient_child_ignores_pendin // builds) XRPL_ASSERT is a no-op, and under ENABLE_VOIDSTAR a failed assert // continues instead of aborting -- in both cases the worker would not crash and // EXPECT_DEATH would report a spurious failure. -TEST_F(SpanGuardScopeTest, scopedGuard_cross_thread_death_asserts_at_wrong_store_destroy) +TEST_F(SpanGuardScopeTest, scoped_guard_cross_thread_death_asserts_at_wrong_store_destroy) { #ifdef NDEBUG GTEST_SKIP() << "XRPL_ASSERT compiles to a no-op under NDEBUG (Release builds), so the " From 0212c8dc4750e8cee4dc0592c8d9c882e570f057 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Wed, 23 Sep 2026 19:04:51 +0100 Subject: [PATCH 2/2] style: Rename gtest test cases to snake_case develop's new fix-gtest-names pre-commit hook requires a snake_case test-case name. CI runs it with --all-files, so the existing CamelCase names fail the check on every branch that carries these files. --- src/tests/libxrpl/telemetry/SpanGuardScope.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/libxrpl/telemetry/SpanGuardScope.cpp b/src/tests/libxrpl/telemetry/SpanGuardScope.cpp index 69329c3f79..c3ea539e00 100644 --- a/src/tests/libxrpl/telemetry/SpanGuardScope.cpp +++ b/src/tests/libxrpl/telemetry/SpanGuardScope.cpp @@ -606,7 +606,7 @@ TEST_F(SpanGuardScopeTest, activate_sets_ambient_without_owning) // OTel key-value-iterable, so a dropped or mistyped pair would be invisible // without reading the exported event back. Values are asserted individually as // well as by count: two attributes with one value blanked still counts as two. -TEST_F(SpanGuardScopeTest, spanGuard_addEvent_records_name_and_attribute_values) +TEST_F(SpanGuardScopeTest, span_guard_add_event_records_name_and_attribute_values) { namespace cs = consensus::span; @@ -640,7 +640,7 @@ TEST_F(SpanGuardScopeTest, spanGuard_addEvent_records_name_and_attribute_values) // The name-only overload records the event with NO attributes, so a regression // that leaked attributes between the two overloads shows up here rather than as // an extra key on a production event. -TEST_F(SpanGuardScopeTest, spanGuard_addEvent_without_attributes_records_bare_event) +TEST_F(SpanGuardScopeTest, span_guard_add_event_without_attributes_records_bare_event) { namespace cs = consensus::span; @@ -664,7 +664,7 @@ TEST_F(SpanGuardScopeTest, spanGuard_addEvent_without_attributes_records_bare_ev // The scoped guard records event attributes too. consensus.accept.apply relies // on it for one tx.included event per transaction of the accepted set. -TEST_F(SpanGuardScopeTest, scopedGuard_addEvent_records_name_and_attribute_values) +TEST_F(SpanGuardScopeTest, scoped_guard_add_event_records_name_and_attribute_values) { namespace cs = consensus::span; @@ -692,7 +692,7 @@ TEST_F(SpanGuardScopeTest, scopedGuard_addEvent_records_name_and_attribute_value // A scoped child of a captured context is the ambient parent of the spans // created after it on the same thread. A hash-derived root created inside that // scope stays a root. consensus.accept.apply relies on both. -TEST_F(SpanGuardScopeTest, scopedChildOfCapturedContextIsAmbientForLaterSpans) +TEST_F(SpanGuardScopeTest, scoped_child_of_captured_context_is_ambient_for_later_spans) { namespace cs = consensus::span;