mirror of
https://github.com/KjellKod/g3log.git
synced 2025-04-17 07:13:28 +02:00
fix unit tests
This commit is contained in:
parent
f3dda737ed
commit
c2ba2546bb
@ -245,6 +245,7 @@ TEST(LogTest, LOG_IF__FATAL) {
|
|||||||
TEST(LogTest, LOG_IF__FATAL__NO_THROW) {
|
TEST(LogTest, LOG_IF__FATAL__NO_THROW) {
|
||||||
RestoreFileLogger logger(log_directory);
|
RestoreFileLogger logger(log_directory);
|
||||||
LOG_IF(FATAL, (2 > 3)) << "This message%sshould NOT throw";
|
LOG_IF(FATAL, (2 > 3)) << "This message%sshould NOT throw";
|
||||||
|
logger.reset();
|
||||||
ASSERT_FALSE(mockFatalWasCalled());
|
ASSERT_FALSE(mockFatalWasCalled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,6 +305,7 @@ TEST(CHECK, CHECK_ThatWontThrow) {
|
|||||||
|
|
||||||
CHECK(1 == 1);
|
CHECK(1 == 1);
|
||||||
CHECK_F(1 == 1, msg.c_str(), "message", "log");
|
CHECK_F(1 == 1, msg.c_str(), "message", "log");
|
||||||
|
logger.reset();
|
||||||
EXPECT_FALSE(mockFatalWasCalled());
|
EXPECT_FALSE(mockFatalWasCalled());
|
||||||
|
|
||||||
std::string file_content = readFileToText(logger.logFile());
|
std::string file_content = readFileToText(logger.logFile());
|
||||||
|
@ -50,7 +50,7 @@ TEST(ConceptSink, OneHundredSinks) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
RestoreFileLogger logger{"/tmp"};
|
RestoreFileLogger logger{"./"};
|
||||||
g2::LogWorker* worker = logger._scope->get(); //g2LogWorker::createWithNoSink();
|
g2::LogWorker* worker = logger._scope->get(); //g2LogWorker::createWithNoSink();
|
||||||
size_t index = 0;
|
size_t index = 0;
|
||||||
for (auto& flag : flags) {
|
for (auto& flag : flags) {
|
||||||
@ -69,6 +69,8 @@ TEST(ConceptSink, OneHundredSinks) {
|
|||||||
write2.append("Hello to 100 receivers :)");
|
write2.append("Hello to 100 receivers :)");
|
||||||
worker->save(message2);
|
worker->save(message2);
|
||||||
LOG(INFO) << "end message";
|
LOG(INFO) << "end message";
|
||||||
|
|
||||||
|
logger.reset();
|
||||||
}
|
}
|
||||||
// at the curly brace above the ScopedLogger will go out of scope and all the
|
// at the curly brace above the ScopedLogger will go out of scope and all the
|
||||||
// 100 logging receivers will get their message to exit after all messages are
|
// 100 logging receivers will get their message to exit after all messages are
|
||||||
|
Loading…
x
Reference in New Issue
Block a user