diff options
author | BrukerJWD <jonathan.wendeborn@bruker.com> | 2018-10-16 06:37:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-16 06:37:56 (GMT) |
commit | 8c82ba48e433005b9e25835b4a342ef4dcc0cfc0 (patch) | |
tree | e1ae94f37108a8f506cd4d11eec0e058c2c39980 /googletest/src/gtest-test-part.cc | |
parent | 6bbf911a8dc0c42ad05135f26a07f4893eb83916 (diff) | |
parent | a651a4d44e65b749467fa3dddf93819a22f0cc4a (diff) | |
download | googletest-8c82ba48e433005b9e25835b4a342ef4dcc0cfc0.zip googletest-8c82ba48e433005b9e25835b4a342ef4dcc0cfc0.tar.gz googletest-8c82ba48e433005b9e25835b4a342ef4dcc0cfc0.tar.bz2 |
Merge branch 'master' into isnice
Diffstat (limited to 'googletest/src/gtest-test-part.cc')
-rw-r--r-- | googletest/src/gtest-test-part.cc | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/googletest/src/gtest-test-part.cc b/googletest/src/gtest-test-part.cc index fb0e354..515b308 100644 --- a/googletest/src/gtest-test-part.cc +++ b/googletest/src/gtest-test-part.cc @@ -26,21 +26,12 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + // -// Author: mheule@google.com (Markus Heule) -// -// The Google C++ Testing Framework (Google Test) +// The Google C++ Testing and Mocking Framework (Google Test) #include "gtest/gtest-test-part.h" - -// Indicates that this translation unit is part of Google Test's -// implementation. It must come before gtest-internal-inl.h is -// included, or there will be a compiler error. This trick exists to -// prevent the accidental inclusion of gtest-internal-inl.h in the -// user's code. -#define GTEST_IMPLEMENTATION_ 1 #include "src/gtest-internal-inl.h" -#undef GTEST_IMPLEMENTATION_ namespace testing { @@ -50,18 +41,21 @@ using internal::GetUnitTestImpl; // in it. std::string TestPartResult::ExtractSummary(const char* message) { const char* const stack_trace = strstr(message, internal::kStackTraceMarker); - return stack_trace == NULL ? message : - std::string(message, stack_trace); + return stack_trace == nullptr ? message : std::string(message, stack_trace); } // Prints a TestPartResult object. std::ostream& operator<<(std::ostream& os, const TestPartResult& result) { - return os - << result.file_name() << ":" << result.line_number() << ": " - << (result.type() == TestPartResult::kSuccess ? "Success" : - result.type() == TestPartResult::kFatalFailure ? "Fatal failure" : - "Non-fatal failure") << ":\n" - << result.message() << std::endl; + return os << result.file_name() << ":" << result.line_number() << ": " + << (result.type() == TestPartResult::kSuccess + ? "Success" + : result.type() == TestPartResult::kSkip + ? "Skipped" + : result.type() == TestPartResult::kFatalFailure + ? "Fatal failure" + : "Non-fatal failure") + << ":\n" + << result.message() << std::endl; } // Appends a TestPartResult to the array. |