"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "googletest/src/gtest-test-part.cc" between
googletest-release-1.11.0.tar.gz and googletest-release-1.12.0.tar.gz

About: GoogleTest is Google's (unit) testing and mocking framework for C++ tests.

gtest-test-part.cc  (googletest-release-1.11.0):gtest-test-part.cc  (googletest-release-1.12.0)
skipping to change at line 54 skipping to change at line 54
std::string TestPartResult::ExtractSummary(const char* message) { std::string TestPartResult::ExtractSummary(const char* message) {
const char* const stack_trace = strstr(message, internal::kStackTraceMarker); const char* const stack_trace = strstr(message, internal::kStackTraceMarker);
return stack_trace == nullptr ? message : std::string(message, stack_trace); return stack_trace == nullptr ? message : std::string(message, stack_trace);
} }
// Prints a TestPartResult object. // Prints a TestPartResult object.
std::ostream& operator<<(std::ostream& os, const TestPartResult& result) { std::ostream& operator<<(std::ostream& os, const TestPartResult& result) {
return os << internal::FormatFileLocation(result.file_name(), return os << internal::FormatFileLocation(result.file_name(),
result.line_number()) result.line_number())
<< " " << " "
<< (result.type() == TestPartResult::kSuccess << (result.type() == TestPartResult::kSuccess ? "Success"
? "Success" : result.type() == TestPartResult::kSkip ? "Skipped"
: result.type() == TestPartResult::kSkip : result.type() == TestPartResult::kFatalFailure
? "Skipped" ? "Fatal failure"
: result.type() == TestPartResult::kFatalFailure : "Non-fatal failure")
? "Fatal failure"
: "Non-fatal failure")
<< ":\n" << ":\n"
<< result.message() << std::endl; << result.message() << std::endl;
} }
// Appends a TestPartResult to the array. // Appends a TestPartResult to the array.
void TestPartResultArray::Append(const TestPartResult& result) { void TestPartResultArray::Append(const TestPartResult& result) {
array_.push_back(result); array_.push_back(result);
} }
// Returns the TestPartResult at the given index (0-based). // Returns the TestPartResult at the given index (0-based).
skipping to change at line 89 skipping to change at line 87
// Returns the number of TestPartResult objects in the array. // Returns the number of TestPartResult objects in the array.
int TestPartResultArray::size() const { int TestPartResultArray::size() const {
return static_cast<int>(array_.size()); return static_cast<int>(array_.size());
} }
namespace internal { namespace internal {
HasNewFatalFailureHelper::HasNewFatalFailureHelper() HasNewFatalFailureHelper::HasNewFatalFailureHelper()
: has_new_fatal_failure_(false), : has_new_fatal_failure_(false),
original_reporter_(GetUnitTestImpl()-> original_reporter_(
GetTestPartResultReporterForCurrentThread()) { GetUnitTestImpl()->GetTestPartResultReporterForCurrentThread()) {
GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(this); GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(this);
} }
HasNewFatalFailureHelper::~HasNewFatalFailureHelper() { HasNewFatalFailureHelper::~HasNewFatalFailureHelper() {
GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread( GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(
original_reporter_); original_reporter_);
} }
void HasNewFatalFailureHelper::ReportTestPartResult( void HasNewFatalFailureHelper::ReportTestPartResult(
const TestPartResult& result) { const TestPartResult& result) {
if (result.fatally_failed()) if (result.fatally_failed()) has_new_fatal_failure_ = true;
has_new_fatal_failure_ = true;
original_reporter_->ReportTestPartResult(result); original_reporter_->ReportTestPartResult(result);
} }
} // namespace internal } // namespace internal
} // namespace testing } // namespace testing
 End of changes. 3 change blocks. 
11 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)