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
ab5b77c1
Commit
ab5b77c1
authored
May 17, 2010
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implements Pointwise().
parent
0f3f5012
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
31 deletions
+21
-31
gmock-generated-matchers.h
include/gmock/gmock-generated-matchers.h
+11
-21
gmock-generated-matchers.h.pump
include/gmock/gmock-generated-matchers.h.pump
+2
-3
gmock-matchers.h
include/gmock/gmock-matchers.h
+0
-0
gmock-generated-matchers_test.cc
test/gmock-generated-matchers_test.cc
+5
-4
gmock-matchers_test.cc
test/gmock-matchers_test.cc
+0
-0
gmock_output_test_golden.txt
test/gmock_output_test_golden.txt
+3
-3
No files found.
include/gmock/gmock-generated-matchers.h
View file @
ab5b77c1
...
@@ -221,7 +221,7 @@ template <class ArgsTuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
...
@@ -221,7 +221,7 @@ template <class ArgsTuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
class
ArgsMatcherImpl
:
public
MatcherInterface
<
ArgsTuple
>
{
class
ArgsMatcherImpl
:
public
MatcherInterface
<
ArgsTuple
>
{
public
:
public
:
// ArgsTuple may have top-level const or reference modifiers.
// ArgsTuple may have top-level const or reference modifiers.
typedef
GTEST_REMOVE_
CONST_
(
GTEST_REMOVE_REFERENCE_
(
ArgsTuple
)
)
RawArgsTuple
;
typedef
GTEST_REMOVE_
REFERENCE_AND_CONST_
(
ArgsTuple
)
RawArgsTuple
;
typedef
typename
internal
::
TupleFields
<
RawArgsTuple
,
k0
,
k1
,
k2
,
k3
,
k4
,
k5
,
typedef
typename
internal
::
TupleFields
<
RawArgsTuple
,
k0
,
k1
,
k2
,
k3
,
k4
,
k5
,
k6
,
k7
,
k8
,
k9
>::
type
SelectedArgs
;
k6
,
k7
,
k8
,
k9
>::
type
SelectedArgs
;
typedef
Matcher
<
const
SelectedArgs
&>
MonomorphicInnerMatcher
;
typedef
Matcher
<
const
SelectedArgs
&>
MonomorphicInnerMatcher
;
...
@@ -314,8 +314,7 @@ class ElementsAreMatcher1 {
...
@@ -314,8 +314,7 @@ class ElementsAreMatcher1 {
template
<
typename
Container
>
template
<
typename
Container
>
operator
Matcher
<
Container
>
()
const
{
operator
Matcher
<
Container
>
()
const
{
typedef
GTEST_REMOVE_CONST_
(
GTEST_REMOVE_REFERENCE_
(
Container
))
typedef
GTEST_REMOVE_REFERENCE_AND_CONST_
(
Container
)
RawContainer
;
RawContainer
;
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
Element
;
Element
;
...
@@ -343,8 +342,7 @@ class ElementsAreMatcher2 {
...
@@ -343,8 +342,7 @@ class ElementsAreMatcher2 {
template
<
typename
Container
>
template
<
typename
Container
>
operator
Matcher
<
Container
>
()
const
{
operator
Matcher
<
Container
>
()
const
{
typedef
GTEST_REMOVE_CONST_
(
GTEST_REMOVE_REFERENCE_
(
Container
))
typedef
GTEST_REMOVE_REFERENCE_AND_CONST_
(
Container
)
RawContainer
;
RawContainer
;
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
Element
;
Element
;
...
@@ -371,8 +369,7 @@ class ElementsAreMatcher3 {
...
@@ -371,8 +369,7 @@ class ElementsAreMatcher3 {
template
<
typename
Container
>
template
<
typename
Container
>
operator
Matcher
<
Container
>
()
const
{
operator
Matcher
<
Container
>
()
const
{
typedef
GTEST_REMOVE_CONST_
(
GTEST_REMOVE_REFERENCE_
(
Container
))
typedef
GTEST_REMOVE_REFERENCE_AND_CONST_
(
Container
)
RawContainer
;
RawContainer
;
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
Element
;
Element
;
...
@@ -401,8 +398,7 @@ class ElementsAreMatcher4 {
...
@@ -401,8 +398,7 @@ class ElementsAreMatcher4 {
template
<
typename
Container
>
template
<
typename
Container
>
operator
Matcher
<
Container
>
()
const
{
operator
Matcher
<
Container
>
()
const
{
typedef
GTEST_REMOVE_CONST_
(
GTEST_REMOVE_REFERENCE_
(
Container
))
typedef
GTEST_REMOVE_REFERENCE_AND_CONST_
(
Container
)
RawContainer
;
RawContainer
;
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
Element
;
Element
;
...
@@ -433,8 +429,7 @@ class ElementsAreMatcher5 {
...
@@ -433,8 +429,7 @@ class ElementsAreMatcher5 {
template
<
typename
Container
>
template
<
typename
Container
>
operator
Matcher
<
Container
>
()
const
{
operator
Matcher
<
Container
>
()
const
{
typedef
GTEST_REMOVE_CONST_
(
GTEST_REMOVE_REFERENCE_
(
Container
))
typedef
GTEST_REMOVE_REFERENCE_AND_CONST_
(
Container
)
RawContainer
;
RawContainer
;
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
Element
;
Element
;
...
@@ -469,8 +464,7 @@ class ElementsAreMatcher6 {
...
@@ -469,8 +464,7 @@ class ElementsAreMatcher6 {
template
<
typename
Container
>
template
<
typename
Container
>
operator
Matcher
<
Container
>
()
const
{
operator
Matcher
<
Container
>
()
const
{
typedef
GTEST_REMOVE_CONST_
(
GTEST_REMOVE_REFERENCE_
(
Container
))
typedef
GTEST_REMOVE_REFERENCE_AND_CONST_
(
Container
)
RawContainer
;
RawContainer
;
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
Element
;
Element
;
...
@@ -507,8 +501,7 @@ class ElementsAreMatcher7 {
...
@@ -507,8 +501,7 @@ class ElementsAreMatcher7 {
template
<
typename
Container
>
template
<
typename
Container
>
operator
Matcher
<
Container
>
()
const
{
operator
Matcher
<
Container
>
()
const
{
typedef
GTEST_REMOVE_CONST_
(
GTEST_REMOVE_REFERENCE_
(
Container
))
typedef
GTEST_REMOVE_REFERENCE_AND_CONST_
(
Container
)
RawContainer
;
RawContainer
;
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
Element
;
Element
;
...
@@ -547,8 +540,7 @@ class ElementsAreMatcher8 {
...
@@ -547,8 +540,7 @@ class ElementsAreMatcher8 {
template
<
typename
Container
>
template
<
typename
Container
>
operator
Matcher
<
Container
>
()
const
{
operator
Matcher
<
Container
>
()
const
{
typedef
GTEST_REMOVE_CONST_
(
GTEST_REMOVE_REFERENCE_
(
Container
))
typedef
GTEST_REMOVE_REFERENCE_AND_CONST_
(
Container
)
RawContainer
;
RawContainer
;
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
Element
;
Element
;
...
@@ -590,8 +582,7 @@ class ElementsAreMatcher9 {
...
@@ -590,8 +582,7 @@ class ElementsAreMatcher9 {
template
<
typename
Container
>
template
<
typename
Container
>
operator
Matcher
<
Container
>
()
const
{
operator
Matcher
<
Container
>
()
const
{
typedef
GTEST_REMOVE_CONST_
(
GTEST_REMOVE_REFERENCE_
(
Container
))
typedef
GTEST_REMOVE_REFERENCE_AND_CONST_
(
Container
)
RawContainer
;
RawContainer
;
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
Element
;
Element
;
...
@@ -635,8 +626,7 @@ class ElementsAreMatcher10 {
...
@@ -635,8 +626,7 @@ class ElementsAreMatcher10 {
template
<
typename
Container
>
template
<
typename
Container
>
operator
Matcher
<
Container
>
()
const
{
operator
Matcher
<
Container
>
()
const
{
typedef
GTEST_REMOVE_CONST_
(
GTEST_REMOVE_REFERENCE_
(
Container
))
typedef
GTEST_REMOVE_REFERENCE_AND_CONST_
(
Container
)
RawContainer
;
RawContainer
;
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
Element
;
Element
;
...
...
include/gmock/gmock-generated-matchers.h.pump
View file @
ab5b77c1
...
@@ -107,7 +107,7 @@ template <class ArgsTuple$for i [[, int k$i = -1]]>
...
@@ -107,7 +107,7 @@ template <class ArgsTuple$for i [[, int k$i = -1]]>
class
ArgsMatcherImpl
:
public
MatcherInterface
<
ArgsTuple
>
{
class
ArgsMatcherImpl
:
public
MatcherInterface
<
ArgsTuple
>
{
public
:
public
:
// ArgsTuple may have top-level const or reference modifiers.
// ArgsTuple may have top-level const or reference modifiers.
typedef
GTEST_REMOVE_
CONST_
(
GTEST_REMOVE_REFERENCE_
(
ArgsTuple
)
)
RawArgsTuple
;
typedef
GTEST_REMOVE_
REFERENCE_AND_CONST_
(
ArgsTuple
)
RawArgsTuple
;
typedef
typename
internal
::
TupleFields
<
RawArgsTuple
,
$
ks
>::
type
SelectedArgs
;
typedef
typename
internal
::
TupleFields
<
RawArgsTuple
,
$
ks
>::
type
SelectedArgs
;
typedef
Matcher
<
const
SelectedArgs
&>
MonomorphicInnerMatcher
;
typedef
Matcher
<
const
SelectedArgs
&>
MonomorphicInnerMatcher
;
...
@@ -200,8 +200,7 @@ class ElementsAreMatcher$i {
...
@@ -200,8 +200,7 @@ class ElementsAreMatcher$i {
template
<
typename
Container
>
template
<
typename
Container
>
operator
Matcher
<
Container
>
()
const
{
operator
Matcher
<
Container
>
()
const
{
typedef
GTEST_REMOVE_CONST_
(
GTEST_REMOVE_REFERENCE_
(
Container
))
typedef
GTEST_REMOVE_REFERENCE_AND_CONST_
(
Container
)
RawContainer
;
RawContainer
;
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
typedef
typename
internal
::
StlContainerView
<
RawContainer
>::
type
::
value_type
Element
;
Element
;
...
...
include/gmock/gmock-matchers.h
View file @
ab5b77c1
This diff is collapsed.
Click to expand it.
test/gmock-generated-matchers_test.cc
View file @
ab5b77c1
...
@@ -192,7 +192,8 @@ TEST(ArgsTest, AcceptsTenTemplateArgs) {
...
@@ -192,7 +192,8 @@ TEST(ArgsTest, AcceptsTenTemplateArgs) {
TEST
(
ArgsTest
,
DescirbesSelfCorrectly
)
{
TEST
(
ArgsTest
,
DescirbesSelfCorrectly
)
{
const
Matcher
<
tuple
<
int
,
bool
,
char
>
>
m
=
Args
<
2
,
0
>
(
Lt
());
const
Matcher
<
tuple
<
int
,
bool
,
char
>
>
m
=
Args
<
2
,
0
>
(
Lt
());
EXPECT_EQ
(
"are a tuple whose fields (#2, #0) are a pair (x, y) where x < y"
,
EXPECT_EQ
(
"are a tuple whose fields (#2, #0) are a pair where "
"the first < the second"
,
Describe
(
m
));
Describe
(
m
));
}
}
...
@@ -200,14 +201,14 @@ TEST(ArgsTest, DescirbesNestedArgsCorrectly) {
...
@@ -200,14 +201,14 @@ TEST(ArgsTest, DescirbesNestedArgsCorrectly) {
const
Matcher
<
const
tuple
<
int
,
bool
,
char
,
int
>&>
m
=
const
Matcher
<
const
tuple
<
int
,
bool
,
char
,
int
>&>
m
=
Args
<
0
,
2
,
3
>
(
Args
<
2
,
0
>
(
Lt
()));
Args
<
0
,
2
,
3
>
(
Args
<
2
,
0
>
(
Lt
()));
EXPECT_EQ
(
"are a tuple whose fields (#0, #2, #3) are a tuple "
EXPECT_EQ
(
"are a tuple whose fields (#0, #2, #3) are a tuple "
"whose fields (#2, #0) are a pair
(x, y) where x < y
"
,
"whose fields (#2, #0) are a pair
where the first < the second
"
,
Describe
(
m
));
Describe
(
m
));
}
}
TEST
(
ArgsTest
,
DescribesNegationCorrectly
)
{
TEST
(
ArgsTest
,
DescribesNegationCorrectly
)
{
const
Matcher
<
tuple
<
int
,
char
>
>
m
=
Args
<
1
,
0
>
(
Gt
());
const
Matcher
<
tuple
<
int
,
char
>
>
m
=
Args
<
1
,
0
>
(
Gt
());
EXPECT_EQ
(
"are a tuple whose fields (#1, #0) are
a pair (x, y)
"
EXPECT_EQ
(
"are a tuple whose fields (#1, #0) are
n't a pair
"
"where
x > y is false
"
,
"where
the first > the second
"
,
DescribeNegation
(
m
));
DescribeNegation
(
m
));
}
}
...
...
test/gmock-matchers_test.cc
View file @
ab5b77c1
This diff is collapsed.
Click to expand it.
test/gmock_output_test_golden.txt
View file @
ab5b77c1
...
@@ -151,7 +151,7 @@ FILE:#: pre-requisite #1
...
@@ -151,7 +151,7 @@ FILE:#: pre-requisite #1
[ RUN ] GMockOutputTest.UnsatisfiedWith
[ RUN ] GMockOutputTest.UnsatisfiedWith
FILE:#: Failure
FILE:#: Failure
Actual function call count doesn't match EXPECT_CALL(foo_, Bar2(_, _))...
Actual function call count doesn't match EXPECT_CALL(foo_, Bar2(_, _))...
Expected args: are a pair
(x, y) where x >= y
Expected args: are a pair
where the first >= the second
Expected: to be called once
Expected: to be called once
Actual: never called - unsatisfied and active
Actual: never called - unsatisfied and active
[ FAILED ] GMockOutputTest.UnsatisfiedWith
[ FAILED ] GMockOutputTest.UnsatisfiedWith
...
@@ -190,7 +190,7 @@ Unexpected mock function call - returning default value.
...
@@ -190,7 +190,7 @@ Unexpected mock function call - returning default value.
Google Mock tried the following 1 expectation, but it didn't match:
Google Mock tried the following 1 expectation, but it didn't match:
FILE:#: EXPECT_CALL(foo_, Bar2(Ge(2), Ge(1)))...
FILE:#: EXPECT_CALL(foo_, Bar2(Ge(2), Ge(1)))...
Expected args: are a pair
(x, y) where x >= y
Expected args: are a pair
where the first >= the second
Actual: don't match
Actual: don't match
Expected: to be called once
Expected: to be called once
Actual: never called - unsatisfied and active
Actual: never called - unsatisfied and active
...
@@ -206,7 +206,7 @@ Google Mock tried the following 1 expectation, but it didn't match:
...
@@ -206,7 +206,7 @@ Google Mock tried the following 1 expectation, but it didn't match:
FILE:#: EXPECT_CALL(foo_, Bar2(Ge(2), Ge(1)))...
FILE:#: EXPECT_CALL(foo_, Bar2(Ge(2), Ge(1)))...
Expected arg #0: is >= 2
Expected arg #0: is >= 2
Actual: 1
Actual: 1
Expected args: are a pair
(x, y) where x >= y
Expected args: are a pair
where the first >= the second
Actual: don't match
Actual: don't match
Expected: to be called once
Expected: to be called once
Actual: never called - unsatisfied and active
Actual: never called - unsatisfied and active
...
...
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