Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
ec44c6c1
Commit
ec44c6c1
authored
Jul 14, 2016
by
Billy Donahue
Committed by
GitHub
Jul 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #821 from mazong1123/master
Fixed issue #775. Mark the ConvertibleFromAny constructor as explicit, and fix operator overload issue for Unprintable
parents
d406cb18
dc2dbf1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
gmock-matchers_test.cc
googlemock/test/gmock-matchers_test.cc
+6
-2
No files found.
googlemock/test/gmock-matchers_test.cc
View file @
ec44c6c1
...
@@ -613,7 +613,7 @@ TEST(MatcherCastTest, FromSameType) {
...
@@ -613,7 +613,7 @@ TEST(MatcherCastTest, FromSameType) {
struct
ConvertibleFromAny
{
struct
ConvertibleFromAny
{
ConvertibleFromAny
(
int
a_value
)
:
value
(
a_value
)
{}
ConvertibleFromAny
(
int
a_value
)
:
value
(
a_value
)
{}
template
<
typename
T
>
template
<
typename
T
>
ConvertibleFromAny
(
const
T
&
/*a_value*/
)
:
value
(
-
1
)
{
explicit
ConvertibleFromAny
(
const
T
&
/*a_value*/
)
:
value
(
-
1
)
{
ADD_FAILURE
()
<<
"Conversion constructor called"
;
ADD_FAILURE
()
<<
"Conversion constructor called"
;
}
}
int
value
;
int
value
;
...
@@ -867,11 +867,15 @@ class Unprintable {
...
@@ -867,11 +867,15 @@ class Unprintable {
public
:
public
:
Unprintable
()
:
c_
(
'a'
)
{}
Unprintable
()
:
c_
(
'a'
)
{}
bool
operator
==
(
const
Unprintable
&
/* rhs */
)
{
return
true
;
}
private
:
private
:
char
c_
;
char
c_
;
};
};
inline
bool
operator
==
(
const
Unprintable
&
/* lhs */
,
const
Unprintable
&
/* rhs */
)
{
return
true
;
}
TEST
(
EqTest
,
CanDescribeSelf
)
{
TEST
(
EqTest
,
CanDescribeSelf
)
{
Matcher
<
Unprintable
>
m
=
Eq
(
Unprintable
());
Matcher
<
Unprintable
>
m
=
Eq
(
Unprintable
());
EXPECT_EQ
(
"is equal to 1-byte object <61>"
,
Describe
(
m
));
EXPECT_EQ
(
"is equal to 1-byte object <61>"
,
Describe
(
m
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment