diff --git a/src/tests/libxrpl/beast/insight/StatsDCollector.cpp b/src/tests/libxrpl/beast/insight/StatsDCollector.cpp index af4b9a3ce5..58e4c6cb32 100644 --- a/src/tests/libxrpl/beast/insight/StatsDCollector.cpp +++ b/src/tests/libxrpl/beast/insight/StatsDCollector.cpp @@ -132,7 +132,7 @@ private: * would otherwise never be sent and would never exist downstream. Absent and * zero must not look the same to an operator. */ -TEST(StatsDCollector, UntouchedGaugePublishesInitialZero) +TEST(StatsDCollector, untouched_gauge_publishes_initial_zero) { LoopbackStatsDServer server; auto const address = ip::Endpoint::fromString("127.0.0.1:" + std::to_string(server.port())); @@ -159,7 +159,7 @@ TEST(StatsDCollector, UntouchedGaugePublishesInitialZero) * comes along as a positive control. One flush tick serves both metrics, so a * counter line would have to travel beside the gauge's. */ -TEST(StatsDCollector, UntouchedCounterPublishesNothing) +TEST(StatsDCollector, untouched_counter_publishes_nothing) { LoopbackStatsDServer server; auto const address = ip::Endpoint::fromString("127.0.0.1:" + std::to_string(server.port())); diff --git a/src/tests/libxrpl/beast/insight/Unit.cpp b/src/tests/libxrpl/beast/insight/Unit.cpp index 29ceac2b32..1f687da8d7 100644 --- a/src/tests/libxrpl/beast/insight/Unit.cpp +++ b/src/tests/libxrpl/beast/insight/Unit.cpp @@ -64,7 +64,7 @@ public: // The unit code is a contract with the collector's Prometheus exporter: it // derives the exported name suffix from this string. Assert the exact codes, // not merely that they differ. -TEST(InsightUnit, otelCodeIsTheUcumCodeForEachUnit) +TEST(InsightUnit, otel_code_is_the_ucum_code_for_each_unit) { EXPECT_STREQ(otelUnitCode(Unit::Millis), "ms"); EXPECT_STREQ(otelUnitCode(Unit::Bytes), "By"); @@ -72,13 +72,13 @@ TEST(InsightUnit, otelCodeIsTheUcumCodeForEachUnit) // The description is what an operator reads in the metric catalogue, so a // byte-valued instrument must not describe itself as a duration. -TEST(InsightUnit, descriptionMatchesWhatTheUnitActuallyMeasures) +TEST(InsightUnit, description_matches_what_the_unit_actually_measures) { EXPECT_STREQ(otelUnitDescription(Unit::Millis), "Duration in ms"); EXPECT_STREQ(otelUnitDescription(Unit::Bytes), "Size in bytes"); } -TEST(InsightUnit, defaultEventUnitIsMillisForBackwardCompatibility) +TEST(InsightUnit, default_event_unit_is_millis_for_backward_compatibility) { // Every pre-existing makeEvent(name) call site records a duration, so the // one-argument overload must keep meaning milliseconds. @@ -88,7 +88,7 @@ TEST(InsightUnit, defaultEventUnitIsMillisForBackwardCompatibility) EXPECT_EQ(event.impl()->unit(), Unit::Millis); } -TEST(InsightUnit, makeEventCarriesTheRequestedUnitToTheImpl) +TEST(InsightUnit, make_event_carries_the_requested_unit_to_the_impl) { auto const collector = NullCollector::make(); auto const event = collector->makeEvent("size", Unit::Bytes); @@ -96,7 +96,7 @@ TEST(InsightUnit, makeEventCarriesTheRequestedUnitToTheImpl) EXPECT_EQ(event.impl()->unit(), Unit::Bytes); } -TEST(InsightUnit, prefixedMakeEventCarriesTheUnit) +TEST(InsightUnit, prefixed_make_event_carries_the_unit) { auto const collector = NullCollector::make(); auto const event = collector->makeEvent("rpc", "size", Unit::Bytes); @@ -104,7 +104,7 @@ TEST(InsightUnit, prefixedMakeEventCarriesTheUnit) EXPECT_EQ(event.impl()->unit(), Unit::Bytes); } -TEST(InsightUnit, groupWrapperForwardsTheUnitAlongWithThePrefix) +TEST(InsightUnit, group_wrapper_forwards_the_unit_along_with_the_prefix) { // ServerHandler creates its events through a Group, not through the // collector directly. If the group's makeEvent override forwards only the @@ -117,7 +117,7 @@ TEST(InsightUnit, groupWrapperForwardsTheUnitAlongWithThePrefix) EXPECT_EQ(event.impl()->unit(), Unit::Bytes); } -TEST(InsightUnit, groupWrapperStillDefaultsToMillis) +TEST(InsightUnit, group_wrapper_still_defaults_to_millis) { auto const collector = NullCollector::make(); auto const groups = makeGroups(collector); @@ -126,7 +126,7 @@ TEST(InsightUnit, groupWrapperStillDefaultsToMillis) EXPECT_EQ(event.impl()->unit(), Unit::Millis); } -TEST(InsightUnit, rawIntegralNotifyPreservesTheValueExactly) +TEST(InsightUnit, raw_integral_notify_preserves_the_value_exactly) { // The byte path must not be rounded or scaled on its way through the // duration-typed storage field. @@ -143,7 +143,7 @@ TEST(InsightUnit, rawIntegralNotifyPreservesTheValueExactly) EXPECT_EQ(impl->samples[2].count(), 1'048'577); } -TEST(InsightUnit, durationNotifyStillRoundsUpToWholeMilliseconds) +TEST(InsightUnit, duration_notify_still_rounds_up_to_whole_milliseconds) { // Pre-existing behaviour, asserted so the new overload cannot quietly // change it: Event applies ceil to whole milliseconds, which is why @@ -161,7 +161,7 @@ TEST(InsightUnit, durationNotifyStillRoundsUpToWholeMilliseconds) EXPECT_EQ(impl->samples[2].count(), 7); } -TEST(InsightUnit, notifyOnANullEventIsSafeForBothOverloads) +TEST(InsightUnit, notify_on_a_null_event_is_safe_for_both_overloads) { // A default-constructed Event has no impl. Both overloads must be no-ops // rather than dereferencing null. diff --git a/src/tests/libxrpl/ledger/AcquireStats.cpp b/src/tests/libxrpl/ledger/AcquireStats.cpp index d4773100ac..cc290dda80 100644 --- a/src/tests/libxrpl/ledger/AcquireStats.cpp +++ b/src/tests/libxrpl/ledger/AcquireStats.cpp @@ -40,7 +40,7 @@ namespace telemetry = xrpl::telemetry; * the same in both configurations, which is what lets a caller report these * accessors without knowing which build it is in. */ -TEST(AcquireStatsTest, StartsAtZero) +TEST(AcquireStatsTest, starts_at_zero) { // Braces matter: without telemetry the counters hold no state, so the type // is trivially default constructible and MSVC rejects a const instance left @@ -62,7 +62,7 @@ TEST(AcquireStatsTest, StartsAtZero) * divergence that identifies the stall, so each step asserts both the counter * that should have moved and the ones that must not have. */ -TEST(AcquireStatsTest, CountersAdvanceIndependently) +TEST(AcquireStatsTest, counters_advance_independently) { AcquireStats stats; @@ -142,7 +142,7 @@ TEST(AcquireStatsTest, CountersAdvanceIndependently) * that had built nothing yet, and the cheap one must leave the partial-work * counter untouched. */ -TEST(AcquireStatsTest, AbortDistinguishesPartialWork) +TEST(AcquireStatsTest, abort_distinguishes_partial_work) { AcquireStats stats; @@ -180,7 +180,7 @@ TEST(AcquireStatsTest, AbortDistinguishesPartialWork) * discarding partial work. Timeouts staying at exactly zero is what proves the * give-up path cannot fire, so that assertion is the point of the test. */ -TEST(AcquireStatsTest, StalledShapeIsDistinguishable) +TEST(AcquireStatsTest, stalled_shape_is_distinguishable) { AcquireStats stalled; for (int i = 0; i < 1000; ++i) @@ -221,7 +221,7 @@ TEST(AcquireStatsTest, StalledShapeIsDistinguishable) * completions dominate. The same seven counters, read the opposite way, which * is what makes the stalled reading above meaningful. */ -TEST(AcquireStatsTest, HealthyShapeIsDistinguishable) +TEST(AcquireStatsTest, healthy_shape_is_distinguishable) { AcquireStats healthy; for (int i = 0; i < 10; ++i) @@ -262,7 +262,7 @@ TEST(AcquireStatsTest, HealthyShapeIsDistinguishable) * from the loop bounds would make the assertion agree with the loop by * construction and pass even if every increment were lost. */ -TEST(AcquireStatsTest, ConcurrentRecordingLosesNothing) +TEST(AcquireStatsTest, concurrent_recording_loses_nothing) { AcquireStats stats; constexpr int kThreads = 4; diff --git a/src/tests/libxrpl/telemetry/ConsensusSpanNames.cpp b/src/tests/libxrpl/telemetry/ConsensusSpanNames.cpp index 1326e55d2e..3b69711acc 100644 --- a/src/tests/libxrpl/telemetry/ConsensusSpanNames.cpp +++ b/src/tests/libxrpl/telemetry/ConsensusSpanNames.cpp @@ -239,7 +239,7 @@ TEST(ConsensusSpanNames, validation_status_values_are_mutually_distinct) // THE RULE, over its whole live domain. The int arguments are // static_cast(ValStatus), so this also pins the enumerator order: Current, // Stale, BadSeq, Multiple, Conflicting. -TEST(ConsensusSpanNames, validationStatusValue_maps_every_val_status) +TEST(ConsensusSpanNames, validation_status_value_maps_every_val_status) { EXPECT_EQ(consensus::span::validationStatusValue(0), consensus::span::val::statusCurrent); EXPECT_EQ(consensus::span::validationStatusValue(1), consensus::span::val::statusStale); @@ -252,7 +252,7 @@ TEST(ConsensusSpanNames, validationStatusValue_maps_every_val_status) // validation was counted for nothing. That split is the diagnostic value of the // attribute -- a node stuck below quorum receiving validations that are all // stale or bad-seq looks, from the outside, exactly like one receiving good ones. -TEST(ConsensusSpanNames, validationStatusValue_separates_counted_from_rejected) +TEST(ConsensusSpanNames, validation_status_value_separates_counted_from_rejected) { EXPECT_EQ(consensus::span::validationStatusValue(0), "current"); for (int const rejected : {1, 2, 3, 4}) @@ -265,7 +265,7 @@ TEST(ConsensusSpanNames, validationStatusValue_separates_counted_from_rejected) // NEGATIVE: an out-of-domain value yields the sentinel, never an empty string. // An empty attribute value would add a blank series to the aggregated dimension, // which is worse than a value labelled "unknown". -TEST(ConsensusSpanNames, validationStatusValue_out_of_domain_is_unknown_not_empty) +TEST(ConsensusSpanNames, validation_status_value_out_of_domain_is_unknown_not_empty) { for (int const bad : {-1, 5, 6, 99}) { @@ -278,7 +278,7 @@ TEST(ConsensusSpanNames, validationStatusValue_out_of_domain_is_unknown_not_empt // The mapping is a compile-time rule, so a wrong value cannot even be built -- // the strongest form of the guarantee, checked by the compiler rather than at // run time. -TEST(ConsensusSpanNames, validationStatusValue_is_a_compile_time_rule) +TEST(ConsensusSpanNames, validation_status_value_is_a_compile_time_rule) { static_assert(consensus::span::validationStatusValue(0) == "current"); static_assert(consensus::span::validationStatusValue(2) == "bad_seq"); diff --git a/src/tests/libxrpl/telemetry/HistogramBuckets.cpp b/src/tests/libxrpl/telemetry/HistogramBuckets.cpp index 8f340e5858..442eb97a2d 100644 --- a/src/tests/libxrpl/telemetry/HistogramBuckets.cpp +++ b/src/tests/libxrpl/telemetry/HistogramBuckets.cpp @@ -33,7 +33,7 @@ class HistogramBucketsTest : public ::testing::TestWithParam{kChargeBuckets}, std::span{kRotationPhaseSecondsBuckets})); -TEST(HistogramBucketsRange, rotationPhaseLadderSpansSecondsToAnHour) +TEST(HistogramBucketsRange, rotation_phase_ladder_spans_seconds_to_an_hour) { // Phases run from seconds (swap) to ten minutes or more (copy), and a whole // rotation about a quarter of an hour. The floor must sit under the shortest @@ -76,7 +76,7 @@ TEST(HistogramBucketsRange, rotationPhaseLadderSpansSecondsToAnHour) EXPECT_EQ(kRotationPhaseSecondsBuckets.back(), 3600.0); } -TEST(HistogramBucketsRange, microsecondFloorLandsBelowTheMeasuredMass) +TEST(HistogramBucketsRange, microsecond_floor_lands_below_the_measured_mass) { // Measured: 99.3% of job_queued_us samples sat below the old 100 us floor, // so p75/p95/p99 all interpolated inside bucket 0 and returned @@ -90,14 +90,14 @@ TEST(HistogramBucketsRange, microsecondFloorLandsBelowTheMeasuredMass) EXPECT_GE(belowHundred, 5) << "too little resolution below 100 us"; } -TEST(HistogramBucketsRange, microsecondCeilingStillReachesOneMinute) +TEST(HistogramBucketsRange, microsecond_ceiling_still_reaches_one_minute) { // Job waits and RPC latencies routinely exceed the SDK default ceiling of // 10,000; multi-second stalls must stay measurable rather than censored. EXPECT_EQ(kMicrosecondBuckets.back(), 60'000'000.0); } -TEST(HistogramBucketsRange, objectCountLadderCannotSaturate) +TEST(HistogramBucketsRange, object_count_ladder_cannot_saturate) { // GetObject counts run 1..kHardMaxReplyNodes, so the top edge IS the hard // cap and censoring is impossible by construction. @@ -105,7 +105,7 @@ TEST(HistogramBucketsRange, objectCountLadderCannotSaturate) EXPECT_EQ(kObjectCountBuckets.back(), 12'288.0); } -TEST(HistogramBucketsRange, chargeLadderBracketsTheResourceThresholds) +TEST(HistogramBucketsRange, charge_ladder_brackets_the_resource_thresholds) { // The two edges that decide a peer's fate must be present so a dashboard // can show how close charges run to each: warning at 5000, drop at 25000. @@ -120,7 +120,7 @@ TEST(HistogramBucketsRange, chargeLadderBracketsTheResourceThresholds) // The validator must also REJECT. A predicate that only ever returns true // would let every ladder above pass while proving nothing. -TEST(HistogramBucketsValidator, rejectsEmptyDescendingDuplicateAndNegative) +TEST(HistogramBucketsValidator, rejects_empty_descending_duplicate_and_negative) { EXPECT_FALSE(isAscendingNonNegative(std::span{})); @@ -134,7 +134,7 @@ TEST(HistogramBucketsValidator, rejectsEmptyDescendingDuplicateAndNegative) EXPECT_FALSE(isAscendingNonNegative(negative)); } -TEST(HistogramBucketsValidator, acceptsASingleEdgeAndALeadingZero) +TEST(HistogramBucketsValidator, accepts_a_single_edge_and_a_leading_zero) { constexpr std::array single{1.0}; EXPECT_TRUE(isAscendingNonNegative(single)); @@ -145,7 +145,7 @@ TEST(HistogramBucketsValidator, acceptsASingleEdgeAndALeadingZero) EXPECT_TRUE(isAscendingNonNegative(leadingZero)); } -TEST(HistogramBucketsRange, millisecondFloorIsOneAndCeilingCoversTheSlowestJob) +TEST(HistogramBucketsRange, millisecond_floor_is_one_and_ceiling_covers_the_slowest_job) { // beast::insight::Event rounds durations up to whole milliseconds, so 1 // is the smallest edge that can ever collect a sample. @@ -157,7 +157,7 @@ TEST(HistogramBucketsRange, millisecondFloorIsOneAndCeilingCoversTheSlowestJob) EXPECT_GE(kMillisecondBuckets.back(), 120'000.0); } -TEST(HistogramBucketsRange, millisecondLadderClearsTheMeasuredCensoringPoint) +TEST(HistogramBucketsRange, millisecond_ladder_clears_the_measured_censoring_point) { // rpc_size had 24.9% of samples above the old 5000 ceiling and // jobq_updatepaths had 100%. A ceiling at or below 5000 reintroduces the @@ -165,7 +165,7 @@ TEST(HistogramBucketsRange, millisecondLadderClearsTheMeasuredCensoringPoint) EXPECT_GT(kMillisecondBuckets.back(), 5'000.0); } -TEST(HistogramBucketsRange, millisecondLadderContainsEveryRepresentableCollectorEdge) +TEST(HistogramBucketsRange, millisecond_ladder_contains_every_representable_collector_edge) { // Agreement with the collector's spanmetrics ladder over the shared // range is the invariant; edges above its 30 s top are allowed because @@ -197,7 +197,7 @@ TEST(HistogramBucketsRange, millisecondLadderContainsEveryRepresentableCollector } } -TEST(HistogramBucketsRange, millisecondLadderResolvesTheOneToFiveSecondBand) +TEST(HistogramBucketsRange, millisecond_ladder_resolves_the_one_to_five_second_band) { // Without these the 1 s to 5 s span was one four-second-wide bucket, so // any quantile landing inside it was interpolated across four seconds. @@ -208,7 +208,7 @@ TEST(HistogramBucketsRange, millisecondLadderResolvesTheOneToFiveSecondBand) } } -TEST(HistogramBucketsRange, byteLadderBracketsTheMeasuredResponseDistribution) +TEST(HistogramBucketsRange, byte_ladder_brackets_the_measured_response_distribution) { // Measured: mean 2131 B, half under 1 kB, three quarters under 5 kB, and // the tail above 5 kB has a mean of at most 7538 B -- which puts p99 @@ -223,7 +223,7 @@ TEST(HistogramBucketsRange, byteLadderBracketsTheMeasuredResponseDistribution) EXPECT_GE(withinWorkingRange, 6) << "too little resolution between 512 B and 64 kB"; } -TEST(HistogramBucketsRange, byteAndMillisecondLaddersAreDistinct) +TEST(HistogramBucketsRange, byte_and_millisecond_ladders_are_distinct) { // A single shared ladder is what put a byte count on a latency scale and // censored a quarter of its samples. @@ -231,14 +231,14 @@ TEST(HistogramBucketsRange, byteAndMillisecondLaddersAreDistinct) EXPECT_GT(kByteBuckets.back(), kMillisecondBuckets.back()); } -TEST(HistogramBucketsConvert, toVectorPreservesOrderAndSize) +TEST(HistogramBucketsConvert, to_vector_preserves_order_and_size) { auto const converted = toVector(kByteBuckets); ASSERT_EQ(converted.size(), kByteBuckets.size()); EXPECT_TRUE(std::ranges::equal(converted, kByteBuckets)); } -TEST(HistogramBucketsConvert, toVectorHandlesAnEmptyLadder) +TEST(HistogramBucketsConvert, to_vector_handles_an_empty_ladder) { EXPECT_TRUE(toVector(std::span{}).empty()); } diff --git a/src/tests/libxrpl/telemetry/LedgerSpanNames.cpp b/src/tests/libxrpl/telemetry/LedgerSpanNames.cpp index deba6a62c0..bd84ee5eb0 100644 --- a/src/tests/libxrpl/telemetry/LedgerSpanNames.cpp +++ b/src/tests/libxrpl/telemetry/LedgerSpanNames.cpp @@ -131,13 +131,13 @@ TEST(LedgerSpanNames, acquire_reason_values_mirror_the_reason_enum) EXPECT_EQ(std::string_view(ledger_span::val::generic), "generic"); } -TEST(LedgerSpanNames, acquireOutcome_normal_done_path_is_complete) +TEST(LedgerSpanNames, acquire_outcome_normal_done_path_is_complete) { // done() after all data was assembled: complete_ set, failed_ clear. EXPECT_EQ(ledger_span::acquireOutcome(/*failed=*/false, /*complete=*/true), "complete"); } -TEST(LedgerSpanNames, acquireOutcome_local_complete_path_is_complete) +TEST(LedgerSpanNames, acquire_outcome_local_complete_path_is_complete) { // The tryDB local-store shortcut in init() reaches the same flag state as // done(), so it must produce the same outcome -- this is the exit that used @@ -145,14 +145,14 @@ TEST(LedgerSpanNames, acquireOutcome_local_complete_path_is_complete) EXPECT_EQ(ledger_span::acquireOutcome(/*failed=*/false, /*complete=*/true), "complete"); } -TEST(LedgerSpanNames, acquireOutcome_failed_path_is_failed) +TEST(LedgerSpanNames, acquire_outcome_failed_path_is_failed) { // Terminal error: bad data, a zero account hash, or the retry budget ran // out. Reached from done() and from the early-return in init(). EXPECT_EQ(ledger_span::acquireOutcome(/*failed=*/true, /*complete=*/false), "failed"); } -TEST(LedgerSpanNames, acquireOutcome_abort_path_is_abandoned) +TEST(LedgerSpanNames, acquire_outcome_abort_path_is_abandoned) { // The destructor / sweep path: neither flag set, because the fetch never // reached a result. This is the assertion the whole change exists for -- an @@ -160,7 +160,7 @@ TEST(LedgerSpanNames, acquireOutcome_abort_path_is_abandoned) EXPECT_EQ(ledger_span::acquireOutcome(/*failed=*/false, /*complete=*/false), "abandoned"); } -TEST(LedgerSpanNames, acquireOutcome_failure_wins_over_completion) +TEST(LedgerSpanNames, acquire_outcome_failure_wins_over_completion) { // Edge case: both flags set. A fetch that hit a terminal error is not a // success regardless of what was assembled, so `failed` must win. Pinned @@ -169,7 +169,7 @@ TEST(LedgerSpanNames, acquireOutcome_failure_wins_over_completion) EXPECT_EQ(ledger_span::acquireOutcome(/*failed=*/true, /*complete=*/true), "failed"); } -TEST(LedgerSpanNames, acquireOutcome_covers_its_whole_input_domain) +TEST(LedgerSpanNames, acquire_outcome_covers_its_whole_input_domain) { // No input combination yields an empty or unknown value, which is the // property that guarantees an exit path can never end up with a blank @@ -191,7 +191,7 @@ TEST(LedgerSpanNames, acquireOutcome_covers_its_whole_input_domain) } } -TEST(LedgerSpanNames, acquireOutcome_is_a_compile_time_rule) +TEST(LedgerSpanNames, acquire_outcome_is_a_compile_time_rule) { // constexpr, so the rule costs nothing at the four call sites and can be // asserted by the compiler itself. static_assert here is the strongest @@ -481,7 +481,7 @@ TEST(LedgerSpanNames, serve_outcome_values_are_the_three_terminal_states) std::string_view(ledger_span::val::refused), std::string_view(ledger_span::val::complete)); } -TEST(LedgerSpanNames, phaseOutcome_normal_completion_is_complete) +TEST(LedgerSpanNames, phase_outcome_normal_completion_is_complete) { // A phase whose tree assembled, or a tx set that arrived: complete_ set, // nothing else. Reached from receiveNode()/trigger() for a phase and from @@ -491,7 +491,7 @@ TEST(LedgerSpanNames, phaseOutcome_normal_completion_is_complete) "complete"); } -TEST(LedgerSpanNames, phaseOutcome_bad_data_is_failed) +TEST(LedgerSpanNames, phase_outcome_bad_data_is_failed) { // A terminal data fault with no timeout: a peer served a tree or set that // would not build. This is the case `timeout` must NOT absorb. @@ -500,7 +500,7 @@ TEST(LedgerSpanNames, phaseOutcome_bad_data_is_failed) "failed"); } -TEST(LedgerSpanNames, phaseOutcome_exhausted_budget_reports_timeout_not_failed) +TEST(LedgerSpanNames, phase_outcome_exhausted_budget_reports_timeout_not_failed) { // THE assertion this rule exists for, and the one that would regress // silently. Both emitters' exhausted-budget path sets timedOut_ AND @@ -513,7 +513,7 @@ TEST(LedgerSpanNames, phaseOutcome_exhausted_budget_reports_timeout_not_failed) "timeout"); } -TEST(LedgerSpanNames, phaseOutcome_timeout_outranks_a_late_completion) +TEST(LedgerSpanNames, phase_outcome_timeout_outranks_a_late_completion) { // Edge case: the budget expired and the data then arrived. It still reports // `timeout`, because the retry budget was really spent -- counting it as a @@ -523,7 +523,7 @@ TEST(LedgerSpanNames, phaseOutcome_timeout_outranks_a_late_completion) "timeout"); } -TEST(LedgerSpanNames, phaseOutcome_dropped_mid_fetch_is_abandoned) +TEST(LedgerSpanNames, phase_outcome_dropped_mid_fetch_is_abandoned) { // No flag at all: the object was destroyed while still fetching (the // InboundLedger sweep, or InboundTransactions::newRound dropping a set). @@ -534,7 +534,7 @@ TEST(LedgerSpanNames, phaseOutcome_dropped_mid_fetch_is_abandoned) "abandoned"); } -TEST(LedgerSpanNames, phaseOutcome_covers_its_whole_input_domain) +TEST(LedgerSpanNames, phase_outcome_covers_its_whole_input_domain) { // No input combination yields an empty or undeclared value, which is the // property that guarantees no exit can end up with a blank outcome and that @@ -569,7 +569,7 @@ TEST(LedgerSpanNames, phaseOutcome_covers_its_whole_input_domain) } } -TEST(LedgerSpanNames, phaseOutcome_is_a_compile_time_rule) +TEST(LedgerSpanNames, phase_outcome_is_a_compile_time_rule) { // constexpr, so the rule costs nothing at its call sites and the mapping is // fixed by the compiler itself. @@ -580,7 +580,7 @@ TEST(LedgerSpanNames, phaseOutcome_is_a_compile_time_rule) SUCCEED(); } -TEST(LedgerSpanNames, serveObjectType_maps_every_protobuf_itype) +TEST(LedgerSpanNames, serve_object_type_maps_every_protobuf_itype) { // The exact protobuf TMLedgerInfoType values, which are fixed by the wire // protocol: liBASE=0, liTX_NODE=1, liAS_NODE=2, liTS_CANDIDATE=3. Passed as @@ -591,7 +591,7 @@ TEST(LedgerSpanNames, serveObjectType_maps_every_protobuf_itype) EXPECT_EQ(ledger_span::serveObjectType(3), "txset"); } -TEST(LedgerSpanNames, serveObjectType_never_yields_an_undeclared_value) +TEST(LedgerSpanNames, serve_object_type_never_yields_an_undeclared_value) { // Edge case: an out-of-range itype cannot occur -- PeerImp::onMessage // rejects the request before the worker runs -- but the rule must still @@ -605,7 +605,7 @@ TEST(LedgerSpanNames, serveObjectType_never_yields_an_undeclared_value) } } -TEST(LedgerSpanNames, serveOutcome_empty_reply_is_refused) +TEST(LedgerSpanNames, serve_outcome_empty_reply_is_refused) { // Seven of the eight exits of processLedgerRequest send nothing, and all of // them reach this through a zero node count. Deriving the value from the @@ -613,13 +613,13 @@ TEST(LedgerSpanNames, serveOutcome_empty_reply_is_refused) EXPECT_EQ(ledger_span::serveOutcome(/*servedNodes=*/0, /*softCap=*/128), "refused"); } -TEST(LedgerSpanNames, serveOutcome_partial_reply_below_cap_is_complete) +TEST(LedgerSpanNames, serve_outcome_partial_reply_below_cap_is_complete) { EXPECT_EQ(ledger_span::serveOutcome(/*servedNodes=*/12, /*softCap=*/128), "complete"); EXPECT_EQ(ledger_span::serveOutcome(/*servedNodes=*/127, /*softCap=*/128), "complete"); } -TEST(LedgerSpanNames, serveOutcome_reply_at_the_cap_is_partial) +TEST(LedgerSpanNames, serve_outcome_reply_at_the_cap_is_partial) { // Edge case at the exact boundary: the assembly loop stops here, so the // requester must come back for the rest. Counting it as a success would @@ -628,7 +628,7 @@ TEST(LedgerSpanNames, serveOutcome_reply_at_the_cap_is_partial) EXPECT_EQ(ledger_span::serveOutcome(/*servedNodes=*/256, /*softCap=*/128), "partial"); } -TEST(LedgerSpanNames, serveOutcome_never_yields_an_undeclared_value) +TEST(LedgerSpanNames, serve_outcome_never_yields_an_undeclared_value) { // Negative counts cannot occur (nodes_size() is non-negative) but must // still map to a declared value rather than an empty attribute. @@ -643,7 +643,7 @@ TEST(LedgerSpanNames, serveOutcome_never_yields_an_undeclared_value) } } -TEST(LedgerSpanNames, serveOutcome_is_a_compile_time_rule) +TEST(LedgerSpanNames, serve_outcome_is_a_compile_time_rule) { static_assert(ledger_span::serveOutcome(0, 128) == std::string_view("refused")); static_assert(ledger_span::serveOutcome(1, 128) == std::string_view("complete")); diff --git a/src/tests/libxrpl/telemetry/RpcMetricNames.cpp b/src/tests/libxrpl/telemetry/RpcMetricNames.cpp index ea27f80f28..1c401b7e22 100644 --- a/src/tests/libxrpl/telemetry/RpcMetricNames.cpp +++ b/src/tests/libxrpl/telemetry/RpcMetricNames.cpp @@ -92,7 +92,7 @@ inline constexpr int kMinBatchItemBytes = 3; } // namespace -TEST(RpcMetricNames, namesAreTheExactExportedSeriesNames) +TEST(RpcMetricNames, names_are_the_exact_exported_series_names) { // These strings ARE the Prometheus series. Changing one is a // dashboard-breaking change, so it has to be a deliberate edit here too. @@ -100,7 +100,7 @@ TEST(RpcMetricNames, namesAreTheExactExportedSeriesNames) EXPECT_EQ(std::string_view{kPathfindDiscoveredPaths}, "pathfind_discovered_paths"); } -TEST(RpcMetricNames, descriptionsAreTheExactExportedHelpText) +TEST(RpcMetricNames, descriptions_are_the_exact_exported_help_text) { // The description becomes the Prometheus `# HELP` line, so it is part of // the exported surface, not a code comment. @@ -110,7 +110,7 @@ TEST(RpcMetricNames, descriptionsAreTheExactExportedHelpText) "Payment paths produced per pathfinding pass, across all source assets"); } -TEST(RpcMetricNames, namesAreLowerSnakeCase) +TEST(RpcMetricNames, names_are_lower_snake_case) { for (std::string_view const name : {std::string_view{kRpcBatchSize}, std::string_view{kPathfindDiscoveredPaths}}) @@ -129,7 +129,7 @@ TEST(RpcMetricNames, namesAreLowerSnakeCase) } } -TEST(RpcMetricNames, namesEndInTheCountedNounAndNotAUnitOrCounterSuffix) +TEST(RpcMetricNames, names_end_in_the_counted_noun_and_not_a_unit_or_counter_suffix) { // Both instruments count things. `_total` is the Prometheus counter suffix // and `_count`/`_sum`/`_bucket` are the ones the exporter appends to a @@ -151,7 +151,7 @@ TEST(RpcMetricNames, namesEndInTheCountedNounAndNotAUnitOrCounterSuffix) } } -TEST(RpcMetricBucketFit, objectCountLadderSeparatesTheSmallestCounts) +TEST(RpcMetricBucketFit, object_count_ladder_separates_the_smallest_counts) { using buckets::kObjectCountBuckets; @@ -177,7 +177,7 @@ TEST(RpcMetricBucketFit, objectCountLadderSeparatesTheSmallestCounts) EXPECT_EQ(bucketIndex(ladder, 16.0), 4u); } -TEST(RpcMetricBucketFit, theSdkDefaultLadderWouldCollapseEverySmallBatch) +TEST(RpcMetricBucketFit, the_sdk_default_ladder_would_collapse_every_small_batch) { // This is why both instruments get an explicit-bucket view. On the SDK // default ladder every batch from 1 to 5 sub-requests lands in one bucket, @@ -197,7 +197,7 @@ TEST(RpcMetricBucketFit, theSdkDefaultLadderWouldCollapseEverySmallBatch) EXPECT_EQ(bucketIndex(chosen, 5.0), 3u); } -TEST(RpcMetricBucketFit, aMaximumSizedBatchStillOverflowsTheLadderCeiling) +TEST(RpcMetricBucketFit, a_maximum_sized_batch_still_overflows_the_ladder_ceiling) { // The documented limitation of rpc_batch_size, as an executable fact. // Nothing caps the sub-request count except the request-size limit, so the @@ -218,7 +218,7 @@ TEST(RpcMetricBucketFit, aMaximumSizedBatchStillOverflowsTheLadderCeiling) // The placement helper must also disagree with the ladder when it should. A // helper that always returned 0 would let every index assertion above pass. -TEST(RpcMetricBucketFit, bucketIndexPlacesAboveAndBelowEveryEdge) +TEST(RpcMetricBucketFit, bucket_index_places_above_and_below_every_edge) { constexpr std::array probe{10.0, 20.0}; std::span const ladder{probe}; diff --git a/src/tests/libxrpl/telemetry/SpanGuardScope.cpp b/src/tests/libxrpl/telemetry/SpanGuardScope.cpp index 647cf59013..88229551a8 100644 --- a/src/tests/libxrpl/telemetry/SpanGuardScope.cpp +++ b/src/tests/libxrpl/telemetry/SpanGuardScope.cpp @@ -368,7 +368,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. @@ -398,7 +398,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; { @@ -435,7 +435,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"); @@ -478,7 +478,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"); @@ -511,7 +511,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; @@ -618,7 +618,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; @@ -652,7 +652,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; @@ -676,7 +676,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; @@ -704,7 +704,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; @@ -755,7 +755,7 @@ TEST_F(SpanGuardScopeTest, scopedChildOfCapturedContextIsAmbientForLaterSpans) // 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(); { @@ -776,7 +776,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(); { @@ -800,7 +800,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(); { @@ -873,7 +873,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 " @@ -954,7 +954,7 @@ makeLedgerHashBytes(std::uint8_t seed) // THE CONTRACT, positive half: three stages of one ledger, created // independently, all land in ONE trace whose id IS the ledger hash. This is what // makes a slow ledger readable as one connected trace instead of three orphans. -TEST_F(SpanGuardScopeTest, ledgerJoin_same_hash_puts_every_stage_in_one_trace) +TEST_F(SpanGuardScopeTest, ledger_join_same_hash_puts_every_stage_in_one_trace) { auto const h = makeLedgerHashBytes(0x11); { @@ -997,7 +997,7 @@ TEST_F(SpanGuardScopeTest, ledgerJoin_same_hash_puts_every_stage_in_one_trace) // THE CONTRACT, negative half: two different ledgers must never share a trace. // Without this the join would be useless -- a single trace would accumulate // every ledger the node ever touched. -TEST_F(SpanGuardScopeTest, ledgerJoin_different_hashes_never_share_a_trace) +TEST_F(SpanGuardScopeTest, ledger_join_different_hashes_never_share_a_trace) { auto const first = makeLedgerHashBytes(0x20); auto const second = makeLedgerHashBytes(0x60); @@ -1029,7 +1029,7 @@ TEST_F(SpanGuardScopeTest, ledgerJoin_different_hashes_never_share_a_trace) // acquire-completion job and from the consensus thread; if the span inherited an // ambient parent it would be swallowed into an unrelated trace on some of those // paths and its trace id would no longer be the ledger hash. -TEST_F(SpanGuardScopeTest, ledgerJoin_ignores_an_ambient_parent) +TEST_F(SpanGuardScopeTest, ledger_join_ignores_an_ambient_parent) { auto const h = makeLedgerHashBytes(0x33); { @@ -1061,7 +1061,7 @@ TEST_F(SpanGuardScopeTest, ledgerJoin_ignores_an_ambient_parent) // is one trace. It is keyed on the VALIDATED ledger hash -- the key // ledger.validate uses -- and deliberately NOT on the previous-ledger hash that // seeds the consensus round trace, which stays a separate trace. -TEST_F(SpanGuardScopeTest, ledgerJoin_validationAccept_joins_the_validated_ledger) +TEST_F(SpanGuardScopeTest, ledger_join_validation_accept_joins_the_validated_ledger) { auto const validated = makeLedgerHashBytes(0x41); auto const previous = makeLedgerHashBytes(0x81); @@ -1099,7 +1099,7 @@ TEST_F(SpanGuardScopeTest, ledgerJoin_validationAccept_joins_the_validated_ledge // guard rather than a span in a garbage trace. The emitters always pass a full // 32-byte hash, so this is the guard rail: a truncated key degrades to "no span" // instead of to a wrong join. -TEST_F(SpanGuardScopeTest, ledgerJoin_too_short_a_key_yields_no_span) +TEST_F(SpanGuardScopeTest, ledger_join_too_short_a_key_yields_no_span) { std::array const tooShort{1, 2, 3, 4, 5, 6, 7, 8}; auto span = SpanGuard::hashSpan(