diff options
author | Fedor Trushkin <ftrushkin@google.com> | 2018-01-17 15:41:59 (GMT) |
---|---|---|
committer | Fedor Trushkin <ftrushkin@google.com> | 2018-01-17 15:41:59 (GMT) |
commit | 9c82e7745c257f38d7dd7ff8a9759ea58b6a4e89 (patch) | |
tree | 9e5187d044021cafe561dd8e63016a0cc4877c1f /googletest/include/gtest/internal/gtest-internal.h | |
parent | 1b077667bd950be0f5b106e033fb820b008ad0c0 (diff) | |
download | googletest-9c82e7745c257f38d7dd7ff8a9759ea58b6a4e89.zip googletest-9c82e7745c257f38d7dd7ff8a9759ea58b6a4e89.tar.gz googletest-9c82e7745c257f38d7dd7ff8a9759ea58b6a4e89.tar.bz2 |
Expose ScopedTrace utility in public interface
Diffstat (limited to 'googletest/include/gtest/internal/gtest-internal.h')
-rw-r--r-- | googletest/include/gtest/internal/gtest-internal.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index 88f94c4..843058f 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -95,7 +95,6 @@ template <typename T> namespace internal { struct TraceInfo; // Information about a trace point. -class ScopedTrace; // Implements scoped trace. class TestInfoImpl; // Opaque implementation of TestInfo class UnitTestImpl; // Opaque implementation of UnitTest @@ -151,48 +150,6 @@ class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error { #endif // GTEST_HAS_EXCEPTIONS -// A helper class for creating scoped traces in user programs. -class GTEST_API_ ScopedTrace { - public: - // The c'tor pushes the given source file location and message onto - // a trace stack maintained by Google Test. - - // Template version. Uses Message() to convert the values into strings. - // Slow, but flexible. - template <typename T> - ScopedTrace(const char* file, int line, const T& message) { - PushTrace(file, line, (Message() << message).GetString()); - } - - // Optimize for some known types. - ScopedTrace(const char* file, int line, const char* message) { - PushTrace(file, line, message ? message : "(null)"); - } - -#if GTEST_HAS_GLOBAL_STRING - ScopedTrace(const char* file, int line, const ::string& message) { - PushTrace(file, line, message); - } -#endif - - ScopedTrace(const char* file, int line, const std::string& message) { - PushTrace(file, line, message); - } - - // The d'tor pops the info pushed by the c'tor. - // - // Note that the d'tor is not virtual in order to be efficient. - // Don't inherit from ScopedTrace! - ~ScopedTrace(); - - private: - void PushTrace(const char* file, int line, std::string message); - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace); -} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its - // c'tor and d'tor. Therefore it doesn't - // need to be used otherwise. - namespace edit_distance { // Returns the optimal edits to go from 'left' to 'right'. // All edits cost the same, with replace having lower priority than |