aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/src
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2017-05-15 17:07:03 -0400
committerNico Weber <thakis@chromium.org>2017-05-15 17:53:04 -0400
commit09fd5b3ebfaac10b78bda664ec7f57fac74ef214 (patch)
tree89a7afc9280b7e42b96391ea2b42075446503e0f /googlemock/src
parent294f72bc773c92410aa3c5ecdd6cd4a757c3fbf4 (diff)
downloadgoogletest-09fd5b3ebfaac10b78bda664ec7f57fac74ef214.tar.gz
googletest-09fd5b3ebfaac10b78bda664ec7f57fac74ef214.tar.bz2
googletest-09fd5b3ebfaac10b78bda664ec7f57fac74ef214.zip
Use std::string and ::string explicitly in gtest and gmock code.
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 'googlemock/src')
-rw-r--r--googlemock/src/gmock-cardinalities.cc2
-rw-r--r--googlemock/src/gmock-internal-utils.cc5
-rw-r--r--googlemock/src/gmock-matchers.cc9
-rw-r--r--googlemock/src/gmock-spec-builders.cc9
4 files changed, 11 insertions, 14 deletions
diff --git a/googlemock/src/gmock-cardinalities.cc b/googlemock/src/gmock-cardinalities.cc
index 50ec7286..335b966e 100644
--- a/googlemock/src/gmock-cardinalities.cc
+++ b/googlemock/src/gmock-cardinalities.cc
@@ -92,7 +92,7 @@ class BetweenCardinalityImpl : public CardinalityInterface {
};
// Formats "n times" in a human-friendly way.
-inline internal::string FormatTimes(int n) {
+inline std::string FormatTimes(int n) {
if (n == 1) {
return "once";
} else if (n == 2) {
diff --git a/googlemock/src/gmock-internal-utils.cc b/googlemock/src/gmock-internal-utils.cc
index fb530801..6464abc2 100644
--- a/googlemock/src/gmock-internal-utils.cc
+++ b/googlemock/src/gmock-internal-utils.cc
@@ -76,7 +76,7 @@ GTEST_API_ string ConvertIdentifierNameToWords(const char* id_name) {
class GoogleTestFailureReporter : public FailureReporterInterface {
public:
virtual void ReportFailure(FailureType type, const char* file, int line,
- const string& message) {
+ const std::string& message) {
AssertHelper(type == kFatal ?
TestPartResult::kFatalFailure :
TestPartResult::kNonFatalFailure,
@@ -128,8 +128,7 @@ GTEST_API_ bool LogIsVisible(LogSeverity severity) {
// stack_frames_to_skip is treated as 0, since we don't know which
// function calls will be inlined by the compiler and need to be
// conservative.
-GTEST_API_ void Log(LogSeverity severity,
- const string& message,
+GTEST_API_ void Log(LogSeverity severity, const std::string& message,
int stack_frames_to_skip) {
if (!LogIsVisible(severity))
return;
diff --git a/googlemock/src/gmock-matchers.cc b/googlemock/src/gmock-matchers.cc
index e7424510..e0de25cb 100644
--- a/googlemock/src/gmock-matchers.cc
+++ b/googlemock/src/gmock-matchers.cc
@@ -379,7 +379,7 @@ void MatchMatrix::Randomize() {
}
}
-string MatchMatrix::DebugString() const {
+std::string MatchMatrix::DebugString() const {
::std::stringstream ss;
const char *sep = "";
for (size_t i = 0; i < LhsSize(); ++i) {
@@ -441,10 +441,9 @@ void UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(
// Returns false, writing an explanation to 'listener', if and only
// if the success criteria are not met.
bool UnorderedElementsAreMatcherImplBase::
-VerifyAllElementsAndMatchersAreMatched(
- const ::std::vector<string>& element_printouts,
- const MatchMatrix& matrix,
- MatchResultListener* listener) const {
+ VerifyAllElementsAndMatchersAreMatched(
+ const ::std::vector<std::string>& element_printouts,
+ const MatchMatrix& matrix, MatchResultListener* listener) const {
bool result = true;
::std::vector<char> element_matched(matrix.LhsSize(), 0);
::std::vector<char> matcher_matched(matrix.RhsSize(), 0);
diff --git a/googlemock/src/gmock-spec-builders.cc b/googlemock/src/gmock-spec-builders.cc
index 95513420..2fa1ee4b 100644
--- a/googlemock/src/gmock-spec-builders.cc
+++ b/googlemock/src/gmock-spec-builders.cc
@@ -58,16 +58,15 @@ GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_gmock_mutex);
// Logs a message including file and line number information.
GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,
const char* file, int line,
- const string& message) {
+ const std::string& message) {
::std::ostringstream s;
s << file << ":" << line << ": " << message << ::std::endl;
Log(severity, s.str(), 0);
}
// Constructs an ExpectationBase object.
-ExpectationBase::ExpectationBase(const char* a_file,
- int a_line,
- const string& a_source_text)
+ExpectationBase::ExpectationBase(const char* a_file, int a_line,
+ const std::string& a_source_text)
: file_(a_file),
line_(a_line),
source_text_(a_source_text),
@@ -244,7 +243,7 @@ GTEST_API_ ThreadLocal<Sequence*> g_gmock_implicit_sequence;
// Reports an uninteresting call (whose description is in msg) in the
// manner specified by 'reaction'.
-void ReportUninterestingCall(CallReaction reaction, const string& msg) {
+void ReportUninterestingCall(CallReaction reaction, const std::string& msg) {
// Include a stack trace only if --gmock_verbose=info is specified.
const int stack_frames_to_skip =
GMOCK_FLAG(verbose) == kInfoVerbosity ? 3 : -1;