refactor: make read-only parameters const

Address cpp:S995 across packet readers, shared service handles, platform
metadata, and callbacks without changing native callback signatures.

Preserve POSIX process-group initialization and make formatted log
writes explicit. Cover empty and embedded-null formatted messages.
This commit is contained in:
ReenigneArcher committed 2026-10-11 21:45:16 -04:00
1 parent da549a8012
commit f6a4abcfbc
21 files changed
+172 -118

No files matched your search

+19
View File
@@ -425,6 +425,25 @@ TEST(LoggingApiTest, StandardFormatOverloadUsesTypedFormatting) {
EXPECT_EQ(messages.front().message.text, "002a 1.25 custom");
}
/**
* @brief Formatted text preserves embedded null bytes and empty messages.
*/
TEST(LoggingApiTest, StandardFormatOverloadPreservesCompleteText) {
using namespace std::string_literals;
auto sink = std::make_shared<recording_sink_t>();
auto owner = logging::add_sink(sink, 0, false);
const auto text = "before\0after"s;
const auto expected = "[before\0after]"s;
logging::info("[{}]", text);
logging::info("{}", std::string_view {});
const auto messages = sink->snapshot();
ASSERT_EQ(messages.size(), 2U);
EXPECT_EQ(messages[0].message.text, expected);
EXPECT_TRUE(messages[1].message.text.empty());
}
/**
* @brief A throwing builder discards partial text without disabling subsequent records.
*/