Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
386391b0
Unverified
Commit
386391b0
authored
Oct 16, 2018
by
Jonathan Wendeborn
Browse files
Use existing Mock::GetReactionOnUninterestingCalls()
parent
6bbf911a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
17 deletions
+3
-17
googlemock/src/gmock-spec-builders.cc
googlemock/src/gmock-spec-builders.cc
+3
-17
No files found.
googlemock/src/gmock-spec-builders.cc
View file @
386391b0
...
...
@@ -707,31 +707,17 @@ bool Mock::VerifyAndClearExpectationsLocked(void* mock_obj)
return
expectations_met
;
}
namespace
{
// checks whether the specified mock_obj has a registered call reaction
bool
HasCallReaction
(
void
*
mock_obj
,
internal
::
CallReaction
reaction
)
{
const
auto
found
=
g_uninteresting_call_reaction
.
find
(
mock_obj
);
if
(
found
==
g_uninteresting_call_reaction
.
cend
())
{
return
internal
::
kDefault
==
reaction
;
}
return
found
->
second
==
reaction
;
}
}
bool
Mock
::
IsNaggy
(
void
*
mock_obj
)
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
)
{
internal
::
MutexLock
l
(
&
internal
::
g_gmock_mutex
);
return
HasCallReaction
(
mock_obj
,
internal
::
kWarn
);
return
Mock
::
GetReactionOnUninterestingCalls
(
mock_obj
)
==
internal
::
kWarn
;
}
bool
Mock
::
IsNice
(
void
*
mock_obj
)
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
)
{
internal
::
MutexLock
l
(
&
internal
::
g_gmock_mutex
);
return
HasCallReaction
(
mock_obj
,
internal
::
kAllow
);
return
Mock
::
GetReactionOnUninterestingCalls
(
mock_obj
)
==
internal
::
kAllow
;
}
bool
Mock
::
IsStrict
(
void
*
mock_obj
)
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
)
{
internal
::
MutexLock
l
(
&
internal
::
g_gmock_mutex
);
return
HasCallReaction
(
mock_obj
,
internal
::
kFail
);
return
Mock
::
GetReactionOnUninterestingCalls
(
mock_obj
)
==
internal
::
kFail
;
}
// Registers a mock object and a mock method it owns.
...
...
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