Make sure that we properly throw away log stuff that isn't of the right level and that we generally log correctly.
| 43 | // Make sure that we properly throw away log stuff that isn't of the right |
| 44 | // level and that we generally log correctly. |
| 45 | TEST(Log, t1) |
| 46 | { |
| 47 | std::string filename(Support::temppath("t1")); |
| 48 | FileUtils::deleteFile(filename); |
| 49 | |
| 50 | // Scope makes sure file gets closed. |
| 51 | { |
| 52 | LogPtr l(Log::makeLog("", filename)); |
| 53 | |
| 54 | l->setLevel(LogLevel::Debug); |
| 55 | |
| 56 | l->get(LogLevel::Debug) << "debug\n"; |
| 57 | l->get(LogLevel::Debug5) << "debug5\n"; |
| 58 | l->get(LogLevel::Info) << "info\n"; |
| 59 | } |
| 60 | |
| 61 | EXPECT_TRUE(Support::compare_text_files(filename, |
| 62 | Support::datapath("logs/t1"))); |
| 63 | } |
| 64 | |
| 65 | // Make sure that devnull thing works. |
| 66 | TEST(Log, t2) |
nothing calls this directly
no test coverage detected