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
dc043e1c
Unverified
Commit
dc043e1c
authored
Apr 25, 2018
by
Gennadiy Civil
Committed by
GitHub
Apr 25, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1588 from gennadiycivil/master
mostly 193547722
parents
a6f06bf2
9af37931
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
16 deletions
+19
-16
gmock-generated-function-mockers.h
googlemock/include/gmock/gmock-generated-function-mockers.h
+0
-0
gmock-generated-function-mockers.h.pump
...ock/include/gmock/gmock-generated-function-mockers.h.pump
+3
-3
gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+0
-0
gmock-matchers_test.cc
googlemock/test/gmock-matchers_test.cc
+16
-13
No files found.
googlemock/include/gmock/gmock-generated-function-mockers.h
View file @
dc043e1c
This diff is collapsed.
Click to expand it.
googlemock/include/gmock/gmock-generated-function-mockers.h.pump
View file @
dc043e1c
...
...
@@ -119,7 +119,7 @@ class FunctionMocker<R($As)> : public
// // error when trying to resolve between this and overload 4 in
// // 'gmock_GetName(WithoutMatchers(), nullptr)'.
// MockSpec<string&()> gmock_GetName(
// const WithoutMatchers&, const Function<string&()>*) const
{
// const WithoutMatchers&, const Function<string&()>*) const
{
// // Removes const from this, calls overload 1
// return AdjustConstness_(this)->gmock_GetName();
// }
...
...
@@ -128,7 +128,7 @@ class FunctionMocker<R($As)> : public
// const string& gmock_GetName() const { … }
// // Overload 4
// MockSpec<const string&()> gmock_GetName(
// const WithoutMatchers&, const Function<const string&()>*) const
{
// const WithoutMatchers&, const Function<const string&()>*) const
{
// // Does not remove const, calls overload 3
// return AdjustConstness_const(this)->gmock_GetName();
// }
...
...
@@ -139,7 +139,7 @@ const MockType* AdjustConstness_const(const MockType* mock) {
return
mock
;
}
// Removes const from and returns the given pointer; this is a helper for the
// Removes const from and returns the given pointer; this is a helper for the
// expectation setter method for parameterless matchers.
template
<
typename
MockType
>
MockType
*
AdjustConstness_
(
const
MockType
*
mock
)
{
...
...
googlemock/include/gmock/gmock-matchers.h
View file @
dc043e1c
This diff is collapsed.
Click to expand it.
googlemock/test/gmock-matchers_test.cc
View file @
dc043e1c
...
...
@@ -59,13 +59,6 @@
# include <forward_list> // NOLINT
#endif
// Disable MSVC2015 warning for std::pair:
// "decorated name length exceeded, name was truncated".
#if defined _MSC_VER
# pragma warning(push)
# pragma warning(disable:4503)
#endif
#if GTEST_LANG_CXX11
# include <type_traits>
#endif
...
...
@@ -749,6 +742,13 @@ TEST(MatcherCastTest, NonImplicitlyConstructibleTypeWithOperatorEq) {
EXPECT_FALSE
(
m3
.
Matches
(
239
));
}
// ConvertibleFromAny does not work with MSVC. resulting in
// error C2440: 'initializing': cannot convert from 'Eq' to 'M'
// No constructor could take the source type, or constructor overload
// resolution was ambiguous
#if !defined _MSC_VER
// The below ConvertibleFromAny struct is implicitly constructible from anything
// and when in the same namespace can interact with other tests. In particular,
// if it is in the same namespace as other tests and one removes
...
...
@@ -761,7 +761,7 @@ namespace convertible_from_any {
struct
ConvertibleFromAny
{
ConvertibleFromAny
(
int
a_value
)
:
value
(
a_value
)
{}
template
<
typename
T
>
explicit
ConvertibleFromAny
(
const
T
&
/*a_value*/
)
:
value
(
-
1
)
{
ConvertibleFromAny
(
const
T
&
/*a_value*/
)
:
value
(
-
1
)
{
ADD_FAILURE
()
<<
"Conversion constructor called"
;
}
int
value
;
...
...
@@ -789,6 +789,8 @@ TEST(MatcherCastTest, FromConvertibleFromAny) {
}
}
// namespace convertible_from_any
#endif // !defined _MSC_VER
struct
IntReferenceWrapper
{
IntReferenceWrapper
(
const
int
&
a_value
)
:
value
(
&
a_value
)
{}
const
int
*
value
;
...
...
@@ -893,6 +895,8 @@ TEST(SafeMatcherCastTest, FromSameType) {
EXPECT_FALSE
(
m2
.
Matches
(
1
));
}
#if !defined _MSC_VER
namespace
convertible_from_any
{
TEST
(
SafeMatcherCastTest
,
ConversionConstructorIsUsed
)
{
Matcher
<
ConvertibleFromAny
>
m
=
SafeMatcherCast
<
ConvertibleFromAny
>
(
1
);
...
...
@@ -908,6 +912,8 @@ TEST(SafeMatcherCastTest, FromConvertibleFromAny) {
}
}
// namespace convertible_from_any
#endif // !defined _MSC_VER
TEST
(
SafeMatcherCastTest
,
ValueIsNotCopied
)
{
int
n
=
42
;
Matcher
<
IntReferenceWrapper
>
m
=
SafeMatcherCast
<
IntReferenceWrapper
>
(
n
);
...
...
@@ -2539,7 +2545,7 @@ TEST(AllOfTest, VariadicMatchesWhenAllMatch) {
::
testing
::
AllOf
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
);
Matcher
<
int
>
m
=
AllOf
(
Ne
(
1
),
Ne
(
2
),
Ne
(
3
),
Ne
(
4
),
Ne
(
5
),
Ne
(
6
),
Ne
(
7
),
Ne
(
8
),
Ne
(
9
),
Ne
(
10
),
Ne
(
11
));
EXPECT_THAT
(
Describe
(
m
),
EndsWith
(
"and (isn't equal to 11)
)))))))))
"
));
EXPECT_THAT
(
Describe
(
m
),
EndsWith
(
"and (isn't equal to 11)"
));
AllOfMatches
(
11
,
m
);
AllOfMatches
(
50
,
AllOf
(
Ne
(
1
),
Ne
(
2
),
Ne
(
3
),
Ne
(
4
),
Ne
(
5
),
Ne
(
6
),
Ne
(
7
),
Ne
(
8
),
Ne
(
9
),
Ne
(
10
),
Ne
(
11
),
Ne
(
12
),
Ne
(
13
),
Ne
(
14
),
Ne
(
15
),
...
...
@@ -2733,7 +2739,7 @@ TEST(AnyOfTest, VariadicMatchesWhenAnyMatches) {
// on ADL.
Matcher
<
int
>
m
=
::
testing
::
AnyOf
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
);
EXPECT_THAT
(
Describe
(
m
),
EndsWith
(
"or (is equal to 11)
)))))))))
"
));
EXPECT_THAT
(
Describe
(
m
),
EndsWith
(
"or (is equal to 11)"
));
AnyOfMatches
(
11
,
m
);
AnyOfMatches
(
50
,
AnyOf
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
...
...
@@ -6761,6 +6767,3 @@ TEST(NotTest, WorksOnMoveOnlyType) {
}
// namespace gmock_matchers_test
}
// namespace testing
#if defined_MSC_VER
# pragma warning(pop)
#endif
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