gtest-test-part.cc (googletest-release-1.10.0) | : | gtest-test-part.cc (googletest-release-1.11.0) | ||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
// | // | |||
// The Google C++ Testing and Mocking Framework (Google Test) | // The Google C++ Testing and Mocking Framework (Google Test) | |||
#include "gtest/gtest-test-part.h" | #include "gtest/gtest-test-part.h" | |||
#include "gtest/internal/gtest-port.h" | ||||
#include "src/gtest-internal-inl.h" | #include "src/gtest-internal-inl.h" | |||
namespace testing { | namespace testing { | |||
using internal::GetUnitTestImpl; | using internal::GetUnitTestImpl; | |||
// Gets the summary of the failure message by omitting the stack trace | // Gets the summary of the failure message by omitting the stack trace | |||
// in it. | // in it. | |||
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 << result.file_name() << ":" << result.line_number() << ": " | return os << internal::FormatFileLocation(result.file_name(), | |||
result.line_number()) | ||||
<< " " | ||||
<< (result.type() == TestPartResult::kSuccess | << (result.type() == TestPartResult::kSuccess | |||
? "Success" | ? "Success" | |||
: result.type() == TestPartResult::kSkip | : result.type() == TestPartResult::kSkip | |||
? "Skipped" | ? "Skipped" | |||
: result.type() == TestPartResult::kFatalFailure | : result.type() == TestPartResult::kFatalFailure | |||
? "Fatal failure" | ? "Fatal failure" | |||
: "Non-fatal failure") | : "Non-fatal failure") | |||
<< ":\n" | << ":\n" | |||
<< result.message() << std::endl; | << result.message() << std::endl; | |||
} | } | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 5 lines changed or added |