summaryrefslogtreecommitdiffstats
path: root/testing/gmock/src
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-29 21:43:25 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-29 21:43:25 +0000
commit145a7ca423cf3a3249ca0329be37dc447f9ce855 (patch)
treecdf1ca18db5e088b671cbdeda33635726d32a1ad /testing/gmock/src
parent02ae88443795ca043b15083898e83ad2811b032b (diff)
downloadchromium_src-145a7ca423cf3a3249ca0329be37dc447f9ce855.zip
chromium_src-145a7ca423cf3a3249ca0329be37dc447f9ce855.tar.gz
chromium_src-145a7ca423cf3a3249ca0329be37dc447f9ce855.tar.bz2
Update gmock and gtest.
(Hoping to pick up a clang-related bug fix.) Review URL: http://codereview.chromium.org/521012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35352 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing/gmock/src')
-rw-r--r--testing/gmock/src/gmock-all.cc5
-rw-r--r--testing/gmock/src/gmock-internal-utils.cc2
-rw-r--r--testing/gmock/src/gmock-matchers.cc12
-rw-r--r--testing/gmock/src/gmock-printers.cc2
-rw-r--r--testing/gmock/src/gmock-spec-builders.cc18
5 files changed, 17 insertions, 22 deletions
diff --git a/testing/gmock/src/gmock-all.cc b/testing/gmock/src/gmock-all.cc
index a14c397..c9223fc 100644
--- a/testing/gmock/src/gmock-all.cc
+++ b/testing/gmock/src/gmock-all.cc
@@ -35,6 +35,11 @@
// purpose is to allow a user to build Google Mock by compiling this
// file alone.
+// This line ensures that gmock.h can be compiled on its own, even
+// when it's fused.
+#include <gmock/gmock.h>
+
+// The following lines pull in the real gmock *.cc files.
#include "src/gmock-cardinalities.cc"
#include "src/gmock-internal-utils.cc"
#include "src/gmock-matchers.cc"
diff --git a/testing/gmock/src/gmock-internal-utils.cc b/testing/gmock/src/gmock-internal-utils.cc
index 196ec74..4c51ec0 100644
--- a/testing/gmock/src/gmock-internal-utils.cc
+++ b/testing/gmock/src/gmock-internal-utils.cc
@@ -64,7 +64,7 @@ string ConvertIdentifierNameToWords(const char* id_name) {
if (isalnum(*p)) {
if (starts_new_word && result != "")
result += ' ';
- result += tolower(*p);
+ result += static_cast<char>(tolower(*p));
}
}
return result;
diff --git a/testing/gmock/src/gmock-matchers.cc b/testing/gmock/src/gmock-matchers.cc
index 79b525d..0abca70 100644
--- a/testing/gmock/src/gmock-matchers.cc
+++ b/testing/gmock/src/gmock-matchers.cc
@@ -83,18 +83,6 @@ int GetParamIndex(const char* param_names[], const string& param_name) {
return kInvalidInterpolation;
}
-// If *pstr starts with the given prefix, modifies *pstr to be right
-// past the prefix and returns true; otherwise leaves *pstr unchanged
-// and returns false. None of pstr, *pstr, and prefix can be NULL.
-bool SkipPrefix(const char* prefix, const char** pstr) {
- const size_t prefix_len = strlen(prefix);
- if (strncmp(*pstr, prefix, prefix_len) == 0) {
- *pstr += prefix_len;
- return true;
- }
- return false;
-}
-
// Helper function used by ValidateMatcherDescription() to format
// error messages.
string FormatMatcherDescriptionSyntaxError(const char* description,
diff --git a/testing/gmock/src/gmock-printers.cc b/testing/gmock/src/gmock-printers.cc
index 8efba78..fd7d305 100644
--- a/testing/gmock/src/gmock-printers.cc
+++ b/testing/gmock/src/gmock-printers.cc
@@ -296,11 +296,9 @@ void PrintStringTo(const ::string& s, ostream* os) {
}
#endif // GTEST_HAS_GLOBAL_STRING
-#if GTEST_HAS_STD_STRING
void PrintStringTo(const ::std::string& s, ostream* os) {
PrintCharsAsStringTo(s.data(), s.size(), os);
}
-#endif // GTEST_HAS_STD_STRING
// Prints a ::wstring object.
#if GTEST_HAS_GLOBAL_WSTRING
diff --git a/testing/gmock/src/gmock-spec-builders.cc b/testing/gmock/src/gmock-spec-builders.cc
index 6cc94dd..02a3227 100644
--- a/testing/gmock/src/gmock-spec-builders.cc
+++ b/testing/gmock/src/gmock-spec-builders.cc
@@ -40,6 +40,7 @@
#include <iostream> // NOLINT
#include <map>
#include <set>
+#include <string>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -55,9 +56,12 @@ namespace internal {
Mutex g_gmock_mutex(Mutex::NO_CONSTRUCTOR_NEEDED_FOR_STATIC_MUTEX);
// Constructs an ExpectationBase object.
-ExpectationBase::ExpectationBase(const char* file, int line)
- : file_(file),
- line_(line),
+ExpectationBase::ExpectationBase(const char* a_file,
+ int a_line,
+ const string& a_source_text)
+ : file_(a_file),
+ line_(a_line),
+ source_text_(a_source_text),
cardinality_specified_(false),
cardinality_(Exactly(1)),
call_count_(0),
@@ -69,9 +73,9 @@ ExpectationBase::~ExpectationBase() {}
// Explicitly specifies the cardinality of this expectation. Used by
// the subclasses to implement the .Times() clause.
-void ExpectationBase::SpecifyCardinality(const Cardinality& cardinality) {
+void ExpectationBase::SpecifyCardinality(const Cardinality& a_cardinality) {
cardinality_specified_ = true;
- cardinality_ = cardinality;
+ cardinality_ = a_cardinality;
}
// Retires all pre-requisites of this expectation.
@@ -423,8 +427,8 @@ void Mock::ClearDefaultActionsLocked(void* mock_obj) {
Expectation::Expectation() {}
Expectation::Expectation(
- const internal::linked_ptr<internal::ExpectationBase>& expectation_base)
- : expectation_base_(expectation_base) {}
+ const internal::linked_ptr<internal::ExpectationBase>& an_expectation_base)
+ : expectation_base_(an_expectation_base) {}
Expectation::~Expectation() {}