aboutsummaryrefslogtreecommitdiffstats
path: root/googletest/test/gtest_output_test_.cc
diff options
context:
space:
mode:
authorConor Burgess <Burgess.Conor@gmail.com>2018-02-12 17:35:07 +0000
committerGitHub <noreply@github.com>2018-02-12 17:35:07 +0000
commitf11a8f9131584cf4009eca8af8a66e920c1b7391 (patch)
tree06cf7b6488c5980a90bcc355f186047f8b5a16c0 /googletest/test/gtest_output_test_.cc
parent27bb844e5c31a0a67b7b4864ffb2b80ae2803882 (diff)
parent15392f1a38fa0b8c3f13a9732e94b209069efa1c (diff)
downloadgoogletest-f11a8f9131584cf4009eca8af8a66e920c1b7391.tar.gz
googletest-f11a8f9131584cf4009eca8af8a66e920c1b7391.tar.bz2
googletest-f11a8f9131584cf4009eca8af8a66e920c1b7391.zip
Merge branch 'master' into fix-argc
Diffstat (limited to 'googletest/test/gtest_output_test_.cc')
-rw-r--r--googletest/test/gtest_output_test_.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/googletest/test/gtest_output_test_.cc b/googletest/test/gtest_output_test_.cc
index 6aaba977..9ae9dc60 100644
--- a/googletest/test/gtest_output_test_.cc
+++ b/googletest/test/gtest_output_test_.cc
@@ -168,6 +168,16 @@ void SubWithTrace(int n) {
SubWithoutTrace(n);
}
+TEST(SCOPED_TRACETest, AcceptedValues) {
+ SCOPED_TRACE("literal string");
+ SCOPED_TRACE(std::string("std::string"));
+ SCOPED_TRACE(1337); // streamable type
+ const char* null_value = NULL;
+ SCOPED_TRACE(null_value);
+
+ ADD_FAILURE() << "Just checking that all these values work fine.";
+}
+
// Tests that SCOPED_TRACE() obeys lexical scopes.
TEST(SCOPED_TRACETest, ObeysScopes) {
printf("(expected to fail)\n");
@@ -315,6 +325,13 @@ TEST(SCOPED_TRACETest, WorksConcurrently) {
}
#endif // GTEST_IS_THREADSAFE
+// Tests basic functionality of the ScopedTrace utility (most of its features
+// are already tested in SCOPED_TRACETest).
+TEST(ScopedTraceTest, WithExplicitFileAndLine) {
+ testing::ScopedTrace trace("explicit_file.cc", 123, "expected trace message");
+ ADD_FAILURE() << "Check that the trace is attached to a particular location.";
+}
+
TEST(DisabledTestsWarningTest,
DISABLED_AlsoRunDisabledTestsFlagSuppressesWarning) {
// This test body is intentionally empty. Its sole purpose is for