Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/google/googletest.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilly Donahue <BillyDonahue@users.noreply.github.com>2016-07-14 20:15:38 +0300
committerGitHub <noreply@github.com>2016-07-14 20:15:38 +0300
commitec44c6c1675c25b9827aacd08c02433cccde7780 (patch)
tree4e1261ac0cbec32a486c2e8a01d0d4e4759cda0a
parentd406cb18c3d73995cec51fc6b39a2aea821b68c1 (diff)
parentdc2dbf1fbf1d10c02c3c3912e4b688333e310aa2 (diff)
Merge pull request #821 from mazong1123/masterrelease-1.8.0
Fixed issue #775. Mark the ConvertibleFromAny constructor as explicit, and fix operator overload issue for Unprintable
-rw-r--r--googlemock/test/gmock-matchers_test.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc
index 78c4c901..9f62c3d8 100644
--- a/googlemock/test/gmock-matchers_test.cc
+++ b/googlemock/test/gmock-matchers_test.cc
@@ -613,7 +613,7 @@ TEST(MatcherCastTest, FromSameType) {
struct ConvertibleFromAny {
ConvertibleFromAny(int a_value) : value(a_value) {}
template <typename T>
- ConvertibleFromAny(const T& /*a_value*/) : value(-1) {
+ explicit ConvertibleFromAny(const T& /*a_value*/) : value(-1) {
ADD_FAILURE() << "Conversion constructor called";
}
int value;
@@ -867,11 +867,15 @@ class Unprintable {
public:
Unprintable() : c_('a') {}
- bool operator==(const Unprintable& /* rhs */) { return true; }
private:
char c_;
};
+inline bool operator==(const Unprintable& /* lhs */,
+ const Unprintable& /* rhs */) {
+ return true;
+}
+
TEST(EqTest, CanDescribeSelf) {
Matcher<Unprintable> m = Eq(Unprintable());
EXPECT_EQ("is equal to 1-byte object <61>", Describe(m));