diff --git a/g2log/test_unit/test_io.cpp b/g2log/test_unit/test_io.cpp index f263f26..15402e5 100644 --- a/g2log/test_unit/test_io.cpp +++ b/g2log/test_unit/test_io.cpp @@ -245,6 +245,7 @@ TEST(LogTest, LOG_IF__FATAL) { TEST(LogTest, LOG_IF__FATAL__NO_THROW) { RestoreFileLogger logger(log_directory); LOG_IF(FATAL, (2 > 3)) << "This message%sshould NOT throw"; + logger.reset(); ASSERT_FALSE(mockFatalWasCalled()); } @@ -304,6 +305,7 @@ TEST(CHECK, CHECK_ThatWontThrow) { CHECK(1 == 1); CHECK_F(1 == 1, msg.c_str(), "message", "log"); + logger.reset(); EXPECT_FALSE(mockFatalWasCalled()); std::string file_content = readFileToText(logger.logFile()); diff --git a/g2log/test_unit/test_sink.cpp b/g2log/test_unit/test_sink.cpp index 737b791..38665f1 100644 --- a/g2log/test_unit/test_sink.cpp +++ b/g2log/test_unit/test_sink.cpp @@ -50,7 +50,7 @@ TEST(ConceptSink, OneHundredSinks) { } { - RestoreFileLogger logger{"/tmp"}; + RestoreFileLogger logger{"./"}; g2::LogWorker* worker = logger._scope->get(); //g2LogWorker::createWithNoSink(); size_t index = 0; for (auto& flag : flags) { @@ -69,6 +69,8 @@ TEST(ConceptSink, OneHundredSinks) { write2.append("Hello to 100 receivers :)"); worker->save(message2); LOG(INFO) << "end message"; + + logger.reset(); } // 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