summaryrefslogtreecommitdiffstats
path: root/googlemock
diff options
context:
space:
mode:
Diffstat (limited to 'googlemock')
-rw-r--r--googlemock/docs/cook_book.md2
-rw-r--r--googlemock/docs/for_dummies.md2
-rw-r--r--googlemock/include/gmock/gmock-spec-builders.h6
-rw-r--r--googlemock/include/gmock/internal/gmock-internal-utils.h4
-rw-r--r--googlemock/test/gmock-internal-utils_test.cc18
-rw-r--r--googlemock/test/gmock-matchers_test.cc2
6 files changed, 12 insertions, 22 deletions
diff --git a/googlemock/docs/cook_book.md b/googlemock/docs/cook_book.md
index 923817e..b28b84e 100644
--- a/googlemock/docs/cook_book.md
+++ b/googlemock/docs/cook_book.md
@@ -178,7 +178,7 @@ class MockStack : public StackInterface<Elem> {
#### Mocking Non-virtual Methods {#MockingNonVirtualMethods}
gMock can mock non-virtual functions to be used in Hi-perf dependency
-injection.<!-- GOOGLETEST_CM0017 DO NOT DELETE -->.
+injection.[See this](http://go/tott/33).
In this case, instead of sharing a common base class with the real class, your
mock class will be *unrelated* to the real class, but contain methods with the
diff --git a/googlemock/docs/for_dummies.md b/googlemock/docs/for_dummies.md
index 9107282..ad00ada 100644
--- a/googlemock/docs/for_dummies.md
+++ b/googlemock/docs/for_dummies.md
@@ -375,7 +375,7 @@ In the above examples, `100` and `50` are also matchers; implicitly, they are
the same as `Eq(100)` and `Eq(50)`, which specify that the argument must be
equal (using `operator==`) to the matcher argument. There are many
[built-in matchers](#MatcherList) for common types (as well as
-[custom matchers](#NewMatchers)); for example:
+[custom matchers](cook_book.md#NewMatchers)); for example:
```cpp
using ::testing::Ge;
diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h
index 735a3bc..0d1adda 100644
--- a/googlemock/include/gmock/gmock-spec-builders.h
+++ b/googlemock/include/gmock/gmock-spec-builders.h
@@ -67,6 +67,7 @@
#include <set>
#include <sstream>
#include <string>
+#include <type_traits>
#include <utility>
#include <vector>
#include "gmock/gmock-actions.h"
@@ -1653,9 +1654,8 @@ class FunctionMocker<R(Args...)> final : public UntypedFunctionMockerBase {
const OnCallSpec<F>* const spec = FindOnCallSpec(args);
if (spec == nullptr) {
- *os << (internal::type_equals<Result, void>::value ?
- "returning directly.\n" :
- "returning default value.\n");
+ *os << (std::is_void<Result>::value ? "returning directly.\n"
+ : "returning default value.\n");
} else {
*os << "taking default action specified at:\n"
<< FormatFileLocation(spec->file(), spec->line()) << "\n";
diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h
index ee00479..7bfa54c 100644
--- a/googlemock/include/gmock/internal/gmock-internal-utils.h
+++ b/googlemock/include/gmock/internal/gmock-internal-utils.h
@@ -359,10 +359,6 @@ GTEST_API_ WithoutMatchers GetWithoutMatchers();
template <typename T> struct is_reference : public false_type {};
template <typename T> struct is_reference<T&> : public true_type {};
-// type_equals<T1, T2>::value is non-zero if T1 and T2 are the same type.
-template <typename T1, typename T2> struct type_equals : public false_type {};
-template <typename T> struct type_equals<T, T> : public true_type {};
-
// remove_reference<T>::type removes the reference from type T, if any.
template <typename T> struct remove_reference { typedef T type; }; // NOLINT
template <typename T> struct remove_reference<T&> { typedef T type; }; // NOLINT
diff --git a/googlemock/test/gmock-internal-utils_test.cc b/googlemock/test/gmock-internal-utils_test.cc
index a76e777..cee13e9 100644
--- a/googlemock/test/gmock-internal-utils_test.cc
+++ b/googlemock/test/gmock-internal-utils_test.cc
@@ -38,6 +38,7 @@
#include <memory>
#include <string>
#include <sstream>
+#include <type_traits>
#include <vector>
#include "gmock/gmock.h"
#include "gmock/internal/gmock-port.h"
@@ -518,19 +519,12 @@ TEST(TypeTraitsTest, is_reference) {
EXPECT_TRUE(is_reference<const int&>::value);
}
-TEST(TypeTraitsTest, type_equals) {
- EXPECT_FALSE((type_equals<int, const int>::value));
- EXPECT_FALSE((type_equals<int, int&>::value));
- EXPECT_FALSE((type_equals<int, double>::value));
- EXPECT_TRUE((type_equals<char, char>::value));
-}
-
TEST(TypeTraitsTest, remove_reference) {
- EXPECT_TRUE((type_equals<char, remove_reference<char&>::type>::value));
- EXPECT_TRUE((type_equals<const int,
- remove_reference<const int&>::type>::value));
- EXPECT_TRUE((type_equals<int, remove_reference<int>::type>::value));
- EXPECT_TRUE((type_equals<double*, remove_reference<double*>::type>::value));
+ EXPECT_TRUE((std::is_same<char, remove_reference<char&>::type>::value));
+ EXPECT_TRUE(
+ (std::is_same<const int, remove_reference<const int&>::type>::value));
+ EXPECT_TRUE((std::is_same<int, remove_reference<int>::type>::value));
+ EXPECT_TRUE((std::is_same<double*, remove_reference<double*>::type>::value));
}
#if GTEST_HAS_STREAM_REDIRECTION
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc
index 74e9294..a61d040 100644
--- a/googlemock/test/gmock-matchers_test.cc
+++ b/googlemock/test/gmock-matchers_test.cc
@@ -6434,7 +6434,7 @@ class SampleVariantIntString {
template <typename T>
friend bool holds_alternative(const SampleVariantIntString& value) {
- return value.has_int_ == internal::IsSame<T, int>::value;
+ return value.has_int_ == std::is_same<T, int>::value;
}
template <typename T>