MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / TEST

Function TEST

tests/src/Base/Console.cpp:77–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75} // namespace
76
77TEST(Console, DirectModeDeliversToObserver)
78{
79 std::mutex mutex;
80 std::vector<CapturedLog> logs;
81 CapturingLogger logger(logs, mutex);
82 ScopedObserver scoped(logger);
83
84 Base::Console().setConnectionMode(Base::ConsoleSingleton::Direct);
85
86 Base::Console().message("Hello %s", "world");
87
88 ASSERT_EQ(1U, logs.size());
89 EXPECT_EQ(Base::LogStyle::Message, logs[0].level);
90 EXPECT_EQ(std::string("Hello world"), logs[0].msg);
91}
92
93TEST(Console, QueuedModeFallsBackToDirectWithoutHandler)
94{

Callers

nothing calls this directly

Calls 9

setConnectionModeMethod · 0.80
setPostEventHandlerMethod · 0.80
setRefreshHandlerMethod · 0.80
enableRefreshMethod · 0.80
messageMethod · 0.45
sizeMethod · 0.45
warningMethod · 0.45
logMethod · 0.45
refreshMethod · 0.45

Tested by

no test coverage detected