mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-12-01 09:30:55 +00:00
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:
21 files changed
+172
-118
No files matched your search
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user