Skip to content

Commit

Permalink
Fixed LogObserver tests failing on Windows
Browse files Browse the repository at this point in the history
Apparently on Windows "%p" does not print a "0x" before the address.
  • Loading branch information
snej committed Jan 10, 2025
1 parent 557f239 commit e91f1f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions LiteCore/tests/LogObserverTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ TEST_CASE_METHOD(LogObserverTest, "LogObserver Logging Objects", "[Log]") {
obj.doLog("goodbye from log object");

REQUIRE(recorder->entries.size() == 3);
CHECK(regex_match(recorder->messages[0], regex(R"(^\{LogObject#\d+\}==> LogObject 0x\w+ @0x\w+$)")));
UNSCOPED_INFO(recorder->messages[0]);
CHECK(regex_match(recorder->messages[0], regex(R"(^\{LogObject#\d+\}==> LogObject \w+ @\w+$)")));
UNSCOPED_INFO(recorder->messages[1]);
CHECK(regex_match(recorder->messages[1], regex(R"(^Obj=/LogObject#\d+/ hi from log object$)")));
UNSCOPED_INFO(recorder->messages[2]);
CHECK(regex_match(recorder->messages[2], regex(R"(^Obj=/LogObject#\d+/ goodbye from log object$)")));
}

Expand All @@ -108,7 +111,7 @@ TEST_CASE_METHOD(LogObserverTest, "LogObserver KV Logging Objects", "[Log]") {

REQUIRE(recorder->entries.size() == 3);
UNSCOPED_INFO(recorder->messages[0]);
CHECK(regex_match(recorder->messages[0], regex(R"(^\{LogObject#\d+\}==> LogObject 0x\w+ @0x\w+$)")));
CHECK(regex_match(recorder->messages[0], regex(R"(^\{LogObject#\d+\}==> LogObject \w+ @\w+$)")));
UNSCOPED_INFO(recorder->messages[1]);
CHECK(regex_match(recorder->messages[1], regex(R"(^Obj=/LogObject#\d+/ energy=low hi from kv object$)")));
UNSCOPED_INFO(recorder->messages[2]);
Expand Down

0 comments on commit e91f1f9

Please sign in to comment.