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
54af9ba5
Commit
54af9ba5
authored
May 04, 2010
by
vladlosev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds a synchronization test.
parent
33605ba4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
gmock-spec-builders_test.cc
test/gmock-spec-builders_test.cc
+16
-2
No files found.
test/gmock-spec-builders_test.cc
View file @
54af9ba5
...
@@ -2358,9 +2358,23 @@ TEST(VerifyAndClearTest, DoesNotAffectOtherMockObjects) {
...
@@ -2358,9 +2358,23 @@ TEST(VerifyAndClearTest, DoesNotAffectOtherMockObjects) {
// action or as a default action without causing a dead lock. It
// action or as a default action without causing a dead lock. It
// verifies that the action is not performed inside the critical
// verifies that the action is not performed inside the critical
// section.
// section.
TEST
(
SynchronizationTest
,
CanCallMockMethodInAction
)
{
MockA
a
;
MockC
c
;
ON_CALL
(
a
,
DoA
(
_
))
.
WillByDefault
(
IgnoreResult
(
InvokeWithoutArgs
(
&
c
,
&
MockC
::
NonVoidMethod
)));
EXPECT_CALL
(
a
,
DoA
(
1
));
EXPECT_CALL
(
a
,
DoA
(
1
))
.
WillOnce
(
Invoke
(
&
a
,
&
MockA
::
DoA
))
.
RetiresOnSaturation
();
EXPECT_CALL
(
c
,
NonVoidMethod
());
void
Helper
(
MockC
*
c
)
{
a
.
DoA
(
1
);
c
->
NonVoidMethod
();
// This will match the second EXPECT_CALL() and trigger another a.DoA(1),
// which will in turn match the first EXPECT_CALL() and trigger a call to
// c.NonVoidMethod() that was specified by the ON_CALL() since the first
// EXPECT_CALL() did not specify an action.
}
}
}
// namespace
}
// namespace
...
...
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