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
6bbf911a
Unverified
Commit
6bbf911a
authored
Oct 16, 2018
by
Jonathan Wendeborn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't fully qualify enum member
parent
67a240a1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
gmock-spec-builders.cc
googlemock/src/gmock-spec-builders.cc
+4
-6
gmock-nice-strict_test.cc
googlemock/test/gmock-nice-strict_test.cc
+1
-2
No files found.
googlemock/src/gmock-spec-builders.cc
View file @
6bbf911a
...
@@ -710,11 +710,9 @@ bool Mock::VerifyAndClearExpectationsLocked(void* mock_obj)
...
@@ -710,11 +710,9 @@ bool Mock::VerifyAndClearExpectationsLocked(void* mock_obj)
namespace
{
namespace
{
// checks whether the specified mock_obj has a registered call reaction
// checks whether the specified mock_obj has a registered call reaction
bool
HasCallReaction
(
void
*
mock_obj
,
internal
::
CallReaction
reaction
)
{
bool
HasCallReaction
(
void
*
mock_obj
,
internal
::
CallReaction
reaction
)
{
using
internal
::
CallReaction
;
const
auto
found
=
g_uninteresting_call_reaction
.
find
(
mock_obj
);
const
auto
found
=
g_uninteresting_call_reaction
.
find
(
mock_obj
);
if
(
found
==
g_uninteresting_call_reaction
.
cend
())
{
if
(
found
==
g_uninteresting_call_reaction
.
cend
())
{
return
internal
::
CallReaction
::
kDefault
==
reaction
;
return
internal
::
kDefault
==
reaction
;
}
}
return
found
->
second
==
reaction
;
return
found
->
second
==
reaction
;
}
}
...
@@ -723,17 +721,17 @@ bool HasCallReaction(void* mock_obj, internal::CallReaction reaction) {
...
@@ -723,17 +721,17 @@ bool HasCallReaction(void* mock_obj, internal::CallReaction reaction) {
bool
Mock
::
IsNaggy
(
void
*
mock_obj
)
bool
Mock
::
IsNaggy
(
void
*
mock_obj
)
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
)
{
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
)
{
internal
::
MutexLock
l
(
&
internal
::
g_gmock_mutex
);
internal
::
MutexLock
l
(
&
internal
::
g_gmock_mutex
);
return
HasCallReaction
(
mock_obj
,
internal
::
CallReaction
::
kWarn
);
return
HasCallReaction
(
mock_obj
,
internal
::
kWarn
);
}
}
bool
Mock
::
IsNice
(
void
*
mock_obj
)
bool
Mock
::
IsNice
(
void
*
mock_obj
)
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
)
{
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
)
{
internal
::
MutexLock
l
(
&
internal
::
g_gmock_mutex
);
internal
::
MutexLock
l
(
&
internal
::
g_gmock_mutex
);
return
HasCallReaction
(
mock_obj
,
internal
::
CallReaction
::
kAllow
);
return
HasCallReaction
(
mock_obj
,
internal
::
kAllow
);
}
}
bool
Mock
::
IsStrict
(
void
*
mock_obj
)
bool
Mock
::
IsStrict
(
void
*
mock_obj
)
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
)
{
GTEST_LOCK_EXCLUDED_
(
internal
::
g_gmock_mutex
)
{
internal
::
MutexLock
l
(
&
internal
::
g_gmock_mutex
);
internal
::
MutexLock
l
(
&
internal
::
g_gmock_mutex
);
return
HasCallReaction
(
mock_obj
,
internal
::
CallReaction
::
kFail
);
return
HasCallReaction
(
mock_obj
,
internal
::
kFail
);
}
}
// Registers a mock object and a mock method it owns.
// Registers a mock object and a mock method it owns.
...
...
googlemock/test/gmock-nice-strict_test.cc
View file @
6bbf911a
...
@@ -161,9 +161,8 @@ TEST(RawMockTest, InfoForUninterestingCall) {
...
@@ -161,9 +161,8 @@ TEST(RawMockTest, InfoForUninterestingCall) {
}
}
TEST
(
RawMockTest
,
IsNaggy_IsNice_IsStrict
)
{
TEST
(
RawMockTest
,
IsNaggy_IsNice_IsStrict
)
{
using
internal
::
CallReaction
;
MockFoo
raw_foo
;
MockFoo
raw_foo
;
ASSERT_EQ
(
CallReaction
::
kDefault
,
CallReaction
::
kWarn
)
<<
"precondition"
;
ASSERT_EQ
(
internal
::
kDefault
,
internal
::
kWarn
)
<<
"precondition"
;
EXPECT_TRUE
(
Mock
::
IsNaggy
(
&
raw_foo
));
EXPECT_TRUE
(
Mock
::
IsNaggy
(
&
raw_foo
));
EXPECT_FALSE
(
Mock
::
IsNice
(
&
raw_foo
));
EXPECT_FALSE
(
Mock
::
IsNice
(
&
raw_foo
));
EXPECT_FALSE
(
Mock
::
IsStrict
(
&
raw_foo
));
EXPECT_FALSE
(
Mock
::
IsStrict
(
&
raw_foo
));
...
...
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