refactor: clarify C++ declarations across 13 Sonar rules (#5934)

This commit is contained in:
Dave Lane authored and GitHub committed 2026-10-14 23:22:57 -04:00
1 parent 2e4d4f5ac0
commit a36b9f8a9c
44 files changed
+342 -162

No files matched your search

+16
View File
@@ -141,6 +141,22 @@ TEST_F(LogRotationTest, FindsSubstringsAtBoundariesAndWithCaseFolding) {
struct LogLevelsTest: BaseTest, testing::WithParamInterface<decltype(log_levels)::value_type> {};
/**
* @brief Periodic logger callbacks preserve their owner's message and numeric formatting.
*/
TEST(PeriodicLoggerTest, ReportsIntegralAndFloatingSamplesWithConfiguredUnits) {
logging::min_max_avg_periodic_logger<int> integral {info, "Integral capture", "ms", std::chrono::seconds {-1}};
logging::min_max_avg_periodic_logger<double> floating {info, "Floating capture", "s", std::chrono::seconds {-1}};
integral.collect_and_log(3);
floating.collect_and_log(1.25);
integral.collect_and_log(7);
floating.collect_and_log(2.5);
EXPECT_TRUE(log_checker::line_contains(log_file, "Integral capture (min/max/avg): 3ms/3ms/3.00ms"));
EXPECT_TRUE(log_checker::line_contains(log_file, "Floating capture (min/max/avg): 1.25s/1.25s/1.25s"));
}
INSTANTIATE_TEST_SUITE_P(
Logging,
LogLevelsTest,