summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjgm@google.com <jgm@google.com@8415998a-534a-0410-bf83-d39667b30386>2012-11-15 15:50:36 +0000
committerjgm@google.com <jgm@google.com@8415998a-534a-0410-bf83-d39667b30386>2012-11-15 15:50:36 +0000
commit6b1759c3816d574bddde3e1725c51a811c8870e7 (patch)
tree95e50c814602bcfb0b62cc06f5843feefa9b1a1e /src
parent917eb00f7d0cc18dbdf6276460d62d450951fafa (diff)
downloadgooglemock-6b1759c3816d574bddde3e1725c51a811c8870e7.tar.gz
Unfortunately, the svn repo is a bit out of date. This commit contains 8
changes that haven't made it to svn. The descriptions of each change are listed below. - Fixes some python shebang lines. - Add ElementsAreArray overloads to gmock. ElementsAreArray now makes a copy of its input elements before the conversion to a Matcher. ElementsAreArray can now take a vector as input. ElementsAreArray can now take an iterator pair as input. - Templatize MatchAndExplain to allow independent string types for the matcher and matchee. I also templatized the ConstCharPointer version of MatchAndExplain to avoid calls with "char*" from using the new templated MatchAndExplain. - Fixes the bug where the constructor of the return type of ElementsAre() saves a reference instead of a copy of the arguments. - Extends ElementsAre() to accept arrays whose sizes aren't known. - Switches gTest's internal FilePath class from testing::internal::String to std::string. testing::internal::String was introduced when gTest couldn't depend on std::string. It's now deprecated. - Switches gTest & gMock from using testing::internal::String objects to std::string. Some static methods of String are still in use. We may be able to remove some but not all of them. In particular, String::Format() should eventually be removed as it truncates the result at 4096 characters, often causing problems. git-svn-id: http://googlemock.googlecode.com/svn/trunk@410 8415998a-534a-0410-bf83-d39667b30386
Diffstat (limited to 'src')
-rw-r--r--src/gmock.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gmock.cc b/src/gmock.cc
index e06acc5..1c06985 100644
--- a/src/gmock.cc
+++ b/src/gmock.cc
@@ -62,7 +62,7 @@ static const char* ParseGoogleMockFlagValue(const char* str,
if (str == NULL || flag == NULL) return NULL;
// The flag must start with "--gmock_".
- const String flag_str = String::Format("--gmock_%s", flag);
+ const std::string flag_str = std::string("--gmock_") + flag;
const size_t flag_len = flag_str.length();
if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
@@ -107,7 +107,7 @@ static bool ParseGoogleMockBoolFlag(const char* str, const char* flag,
// On success, stores the value of the flag in *value, and returns
// true. On failure, returns false without changing *value.
static bool ParseGoogleMockStringFlag(const char* str, const char* flag,
- String* value) {
+ std::string* value) {
// Gets the value of the flag as a string.
const char* const value_str = ParseGoogleMockFlagValue(str, flag, false);
@@ -131,7 +131,7 @@ void InitGoogleMockImpl(int* argc, CharType** argv) {
if (*argc <= 0) return;
for (int i = 1; i != *argc; i++) {
- const String arg_string = StreamableToString(argv[i]);
+ const std::string arg_string = StreamableToString(argv[i]);
const char* const arg = arg_string.c_str();
// Do we see a Google Mock flag?