summaryrefslogtreecommitdiffstats
path: root/include/gtest/internal/gtest-type-util.h
diff options
context:
space:
mode:
authorjgm <jgm@google.com>2012-11-15 15:47:38 (GMT)
committerjgm <jgm@google.com>2012-11-15 15:47:38 (GMT)
commit87fdda2cf24d953f3cbec1e0c266b2db9928f406 (patch)
tree640cd727bab672105c57f563091dc58b7a81a1be /include/gtest/internal/gtest-type-util.h
parent78bf6d5724e733cce313228856e18d5c372b4fb3 (diff)
downloadgoogletest-87fdda2cf24d953f3cbec1e0c266b2db9928f406.zip
googletest-87fdda2cf24d953f3cbec1e0c266b2db9928f406.tar.gz
googletest-87fdda2cf24d953f3cbec1e0c266b2db9928f406.tar.bz2
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.
Diffstat (limited to 'include/gtest/internal/gtest-type-util.h')
-rw-r--r--include/gtest/internal/gtest-type-util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/gtest/internal/gtest-type-util.h b/include/gtest/internal/gtest-type-util.h
index ed58fce..4a7d946 100644
--- a/include/gtest/internal/gtest-type-util.h
+++ b/include/gtest/internal/gtest-type-util.h
@@ -62,7 +62,7 @@ namespace internal {
// NB: This function is also used in Google Mock, so don't move it inside of
// the typed-test-only section below.
template <typename T>
-String GetTypeName() {
+std::string GetTypeName() {
# if GTEST_HAS_RTTI
const char* const name = typeid(T).name();
@@ -74,7 +74,7 @@ String GetTypeName() {
using abi::__cxa_demangle;
# endif // GTEST_HAS_CXXABI_H_
char* const readable_name = __cxa_demangle(name, 0, 0, &status);
- const String name_str(status == 0 ? readable_name : name);
+ const std::string name_str(status == 0 ? readable_name : name);
free(readable_name);
return name_str;
# else