X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Flogging_unittest.cc;h=b8a9a87287222747f99b6a17473fc64a2e8d3282;hb=2fe6508e536032b321067a541b6f0a3a54089bc3;hp=e180567d77d71bcf0b2cdf90d30a5a20f6fe9d8d;hpb=a94afc6807eba4ea4c3638f1aa6c3da182122f4c;p=platform%2Fupstream%2Fglog.git diff --git a/src/logging_unittest.cc b/src/logging_unittest.cc index e180567..b8a9a87 100644 --- a/src/logging_unittest.cc +++ b/src/logging_unittest.cc @@ -272,17 +272,24 @@ void TestLogging(bool check_counts) { LOG(ERROR) << string("foo") << ' '<< j << ' ' << setw(10) << j << " " << setw(1) << hex << j; + { + google::LogMessage outer(__FILE__, __LINE__, google::ERROR); + outer.stream() << "outer"; + + LOG(ERROR) << "inner"; + } + LogMessage("foo", LogMessage::kNoLogPrefix, GLOG_INFO).stream() << "no prefix"; if (check_counts) { CHECK_EQ(base_num_infos + 14, LogMessage::num_messages(GLOG_INFO)); CHECK_EQ(base_num_warning + 3, LogMessage::num_messages(GLOG_WARNING)); - CHECK_EQ(base_num_errors + 15, LogMessage::num_messages(GLOG_ERROR)); + CHECK_EQ(base_num_errors + 17, LogMessage::num_messages(GLOG_ERROR)); } } static void NoAllocNewHook() { - CHECK(false) << "unexpected new"; + LOG(FATAL) << "unexpected new"; } struct NewHook { @@ -628,14 +635,15 @@ static void GetFiles(const string& pattern, vector* files) { LOG(FATAL) << "No directory separator."; } const string dirname = pattern.substr(0, index + 1); - if (FAILED(handle)) { + if (handle == INVALID_HANDLE_VALUE) { // Finding no files is OK. return; } do { files->push_back(dirname + data.cFileName); } while (FindNextFileA(handle, &data)); - LOG_SYSRESULT(FindClose(handle)); + BOOL result = FindClose(handle); + LOG_SYSRESULT(result); #else # error There is no way to do glob. #endif