From e91f1f909fb70c99b8ab33fe24e7cbf65adede47 Mon Sep 17 00:00:00 2001 From: Jens Alfke Date: Fri, 10 Jan 2025 10:10:50 -0800 Subject: [PATCH] Fixed LogObserver tests failing on Windows Apparently on Windows "%p" does not print a "0x" before the address. --- LiteCore/tests/LogObserverTest.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/LiteCore/tests/LogObserverTest.cc b/LiteCore/tests/LogObserverTest.cc index 94d404a93..e74c540c7 100644 --- a/LiteCore/tests/LogObserverTest.cc +++ b/LiteCore/tests/LogObserverTest.cc @@ -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$)"))); } @@ -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]);