| 31 | }; |
| 32 | |
| 33 | TEST_F(AsyncLogStreamTest, write_to_file_object) { |
| 34 | LoggerBuilder builder; |
| 35 | builder.set_log_stream_creator( |
| 36 | AsyncLogStream::creator(appender, file_object)); |
| 37 | ::babylon::LoggerManager::instance().set_root_builder(::std::move(builder)); |
| 38 | ::babylon::LoggerManager::instance().apply(); |
| 39 | |
| 40 | ::testing::internal::CaptureStderr(); |
| 41 | BABYLON_LOG(INFO) << "this line should appear in stderr with num " << 10010; |
| 42 | appender.close(); |
| 43 | auto text = ::testing::internal::GetCapturedStderr(); |
| 44 | |
| 45 | ::std::cerr << text; |
| 46 | ASSERT_NE(text.npos, |
| 47 | text.find("this line should appear in stderr with num 10010")); |
| 48 | } |
| 49 | |
| 50 | TEST_F(AsyncLogStreamTest, write_header_before_message) { |
| 51 | LoggerBuilder builder; |
nothing calls this directly
no test coverage detected