Skip to content

Commit

Permalink
fixed format macro sensitive tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KjellKod committed Nov 30, 2023
1 parent 0e22360 commit b76d466
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test_unit/test_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,9 @@ TEST(CustomLogLevels, AddANonFatal__ThenReset) {
TEST(CustomLogLevels, AddANonFatal__DidNotAddItToEnabledValue1) {
RestoreFileLogger logger(log_directory);
const LEVELS MYINFO{WARNING.value + 2, {"MY_INFO_LEVEL"}};
LOG(MYINFO) << "Testing my own custom level";
auto line = __LINE__;
// clang-format off
LOG(MYINFO) << "Testing my own custom level"; auto line = __LINE__;
// clang-format on
logger.reset();

std::string file_content = readFileToText(logger.logFile());
Expand All @@ -700,8 +701,9 @@ TEST(CustomLogLevels, AddANonFatal__DidNotAddItToEnabledValue2) {
RestoreFileLogger logger(log_directory);
const LEVELS MYINFO{WARNING.value + 2, {"MY_INFO_LEVEL"}};
EXPECT_FALSE(g3::logLevel(MYINFO));
LOG(MYINFO) << "Testing my own custom level";
auto line = __LINE__;
// clang-format off
LOG(MYINFO) << "Testing my own custom level"; auto line = __LINE__;
// clang-format on
logger.reset();

std::string file_content = readFileToText(logger.logFile());
Expand All @@ -717,8 +719,9 @@ TEST(CustomLogLevels, AddANonFatal__DidtAddItToEnabledValue) {
RestoreFileLogger logger(log_directory);
const LEVELS MYINFO{WARNING.value + 3, {"MY_INFO_LEVEL"}};
g3::only_change_at_initialization::addLogLevel(MYINFO, true);
LOG(MYINFO) << "Testing my own custom level";
auto line = __LINE__;
// clang-format off
LOG(MYINFO) << "Testing my own custom level"; auto line = __LINE__;
// clang-format on
logger.reset();
std::string file_content = readFileToText(logger.logFile());
std::string expected;
Expand Down

0 comments on commit b76d466

Please sign in to comment.