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
549c5d06
Commit
549c5d06
authored
Jun 15, 2020
by
Abseil Team
Committed by
Andy Getz
Jun 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Googletest export
gMock Cookbook: Fix incorrect comment about EXPECT priority order It's actually the last matching expectation that's used, not the first. PiperOrigin-RevId: 316490770
parent
8567b092
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
cook_book.md
googlemock/docs/cook_book.md
+5
-5
No files found.
googlemock/docs/cook_book.md
View file @
549c5d06
...
...
@@ -1675,11 +1675,11 @@ times from calling it with the wrong arguments.
### Expecting Ordered Calls {#OrderedCalls}
Although an
`EXPECT_CALL()`
statement defined
earlier takes precedence when
gMock tries to match a function call with an expectation, by default calls don't
have to happen in the order
`EXPECT_CALL()`
statements are written. For example,
if the arguments match the matchers in the third
`EXPECT_CALL()`
, but not those
in the first two, then the thir
d expectation will be used.
Although an
`EXPECT_CALL()`
statement defined
later takes precedence when gMock
tries to match a function call with an expectation, by default calls don't have
to happen in the order
`EXPECT_CALL()`
statements are written. For example, if
the arguments match the matchers in the second
`EXPECT_CALL()`
, but not those in
the first and third, then the secon
d expectation will be used.
If you would rather have all calls occur in the order of the expectations, put
the
`EXPECT_CALL()`
statements in a block where you define a variable of type
...
...
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