Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
odygrd committed Feb 7, 2025
1 parent eed05c0 commit 5eb9d2f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/integration_tests/StringLoggingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ TEST_CASE("string_logging")
LOG_INFO(logger, "Logging int: {}, int: {}, string: {}, char: {}", i, i * 10, v, v.c_str());
}

// Log 12+ char arrays to catch any compiler warnings in InlinedVector
LOG_INFO(logger, "{} {} {} {} {} {} {} {} {} {} {} {} {} {}", "abc", "def", "ghi", "abc", "def",
"ghi", "abc", "def", "ghi", "abc", "def", "ghi", "abc", "def");

logger->flush_log();
Frontend::remove_logger(logger);

Expand All @@ -156,7 +160,7 @@ TEST_CASE("string_logging")

// Read file and check
std::vector<std::string> const file_contents = quill::testing::file_contents(filename);
REQUIRE_EQ(file_contents.size(), number_of_messages + 18);
REQUIRE_EQ(file_contents.size(), number_of_messages + 19);

REQUIRE(quill::testing::file_contains(
file_contents, std::string{"LOG_INFO " + logger_name + " right aligned"}));
Expand Down Expand Up @@ -221,5 +225,8 @@ TEST_CASE("string_logging")
REQUIRE(quill::testing::file_contains(
file_contents, std::string{"LOG_INFO " + logger_name + " Logging int: 9999, int: 99990, string: Lorem ipsum dolor sit amet, consectetur 9999, char: Lorem ipsum dolor sit amet, consectetur 9999"}));

REQUIRE(quill::testing::file_contains(
file_contents, std::string{"LOG_INFO " + logger_name + " abc def ghi abc def ghi abc def ghi abc def ghi abc def"}));

testing::remove_file(filename);
}

0 comments on commit 5eb9d2f

Please sign in to comment.