diff options
author | Nico Weber <thakis@chromium.org> | 2017-05-15 21:07:03 (GMT) |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2017-05-15 21:53:04 (GMT) |
commit | 09fd5b3ebfaac10b78bda664ec7f57fac74ef214 (patch) | |
tree | 89a7afc9280b7e42b96391ea2b42075446503e0f /googletest/include/gtest/gtest-printers.h | |
parent | 294f72bc773c92410aa3c5ecdd6cd4a757c3fbf4 (diff) | |
download | googletest-09fd5b3ebfaac10b78bda664ec7f57fac74ef214.zip googletest-09fd5b3ebfaac10b78bda664ec7f57fac74ef214.tar.gz googletest-09fd5b3ebfaac10b78bda664ec7f57fac74ef214.tar.bz2 |
Use std::string and ::string explicitly in gtest and gmock code.refs/pull/1089/head
This merges a Google-internal change (117235625).
Original CL description:
This CL was created manually in about an hour with sed, a Python script
to find all the places unqualified 'string' was mentioned, and some help
from Emacs to add the "std::" qualifications, plus a few manual tweaks.
Diffstat (limited to 'googletest/include/gtest/gtest-printers.h')
-rw-r--r-- | googletest/include/gtest/gtest-printers.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 8a33164..f587e71 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -151,10 +151,10 @@ template <typename T> class TypeWithoutFormatter<T, kProtobuf> { public: static void PrintValue(const T& value, ::std::ostream* os) { - const ::testing::internal::string short_str = value.ShortDebugString(); - const ::testing::internal::string pretty_str = - short_str.length() <= kProtobufOneLinerMaxLength ? - short_str : ("\n" + value.DebugString()); + std::string pretty_str = value.ShortDebugString(); + if (pretty_str.length() > kProtobufOneLinerMaxLength) { + pretty_str = "\n" + value.DebugString(); + } *os << ("<" + pretty_str + ">"); } }; @@ -805,7 +805,7 @@ class UniversalTersePrinter<const char*> { if (str == NULL) { *os << "NULL"; } else { - UniversalPrint(string(str), os); + UniversalPrint(std::string(str), os); } } }; |