fix unit tests

This commit is contained in:
Aleksey Dobrunov 2013-12-14 02:58:36 +06:00
parent f3dda737ed
commit c2ba2546bb
2 changed files with 5 additions and 1 deletions

View File

@ -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());

View File

@ -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