Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
3feffddd
Commit
3feffddd
authored
Oct 28, 2018
by
Vadim Barkov
Browse files
Replaced all NULLs with nullptr in googlemock
parent
53d61b5b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
googlemock/include/gmock/gmock-spec-builders.h
googlemock/include/gmock/gmock-spec-builders.h
+1
-1
googlemock/src/gmock-spec-builders.cc
googlemock/src/gmock-spec-builders.cc
+2
-2
googlemock/test/gmock-generated-function-mockers_test.cc
googlemock/test/gmock-generated-function-mockers_test.cc
+3
-3
googlemock/test/gmock-matchers_test.cc
googlemock/test/gmock-matchers_test.cc
+3
-3
googlemock/test/gmock_link_test.h
googlemock/test/gmock_link_test.h
+1
-1
No files found.
googlemock/include/gmock/gmock-spec-builders.h
View file @
3feffddd
...
@@ -1914,7 +1914,7 @@ GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
...
@@ -1914,7 +1914,7 @@ GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
// failure to disambiguate two overloads of this method in the ON_CALL statement
// failure to disambiguate two overloads of this method in the ON_CALL statement
// is how we block callers from setting expectations on overloaded methods.
// is how we block callers from setting expectations on overloaded methods.
#define GMOCK_ON_CALL_IMPL_(mock_expr, Setter, call) \
#define GMOCK_ON_CALL_IMPL_(mock_expr, Setter, call) \
((mock_expr).gmock_##call)(::testing::internal::GetWithoutMatchers(),
NULL
) \
((mock_expr).gmock_##call)(::testing::internal::GetWithoutMatchers(),
nullptr
) \
.Setter(__FILE__, __LINE__, #mock_expr, #call)
.Setter(__FILE__, __LINE__, #mock_expr, #call)
#define ON_CALL(obj, call) \
#define ON_CALL(obj, call) \
...
...
googlemock/src/gmock-spec-builders.cc
View file @
3feffddd
...
@@ -866,7 +866,7 @@ void Sequence::AddExpectation(const Expectation& expectation) const {
...
@@ -866,7 +866,7 @@ void Sequence::AddExpectation(const Expectation& expectation) const {
// Creates the implicit sequence if there isn't one.
// Creates the implicit sequence if there isn't one.
InSequence
::
InSequence
()
{
InSequence
::
InSequence
()
{
if
(
internal
::
g_gmock_implicit_sequence
.
get
()
==
NULL
)
{
if
(
internal
::
g_gmock_implicit_sequence
.
get
()
==
nullptr
)
{
internal
::
g_gmock_implicit_sequence
.
set
(
new
Sequence
);
internal
::
g_gmock_implicit_sequence
.
set
(
new
Sequence
);
sequence_created_
=
true
;
sequence_created_
=
true
;
}
else
{
}
else
{
...
@@ -879,7 +879,7 @@ InSequence::InSequence() {
...
@@ -879,7 +879,7 @@ InSequence::InSequence() {
InSequence
::~
InSequence
()
{
InSequence
::~
InSequence
()
{
if
(
sequence_created_
)
{
if
(
sequence_created_
)
{
delete
internal
::
g_gmock_implicit_sequence
.
get
();
delete
internal
::
g_gmock_implicit_sequence
.
get
();
internal
::
g_gmock_implicit_sequence
.
set
(
NULL
);
internal
::
g_gmock_implicit_sequence
.
set
(
nullptr
);
}
}
}
}
...
...
googlemock/test/gmock-generated-function-mockers_test.cc
View file @
3feffddd
...
@@ -225,7 +225,7 @@ TEST_F(FunctionMockerTest, MocksBinaryFunction) {
...
@@ -225,7 +225,7 @@ TEST_F(FunctionMockerTest, MocksBinaryFunction) {
// Tests mocking a decimal function.
// Tests mocking a decimal function.
TEST_F
(
FunctionMockerTest
,
MocksDecimalFunction
)
{
TEST_F
(
FunctionMockerTest
,
MocksDecimalFunction
)
{
EXPECT_CALL
(
mock_foo_
,
Decimal
(
true
,
'a'
,
0
,
0
,
1L
,
A
<
float
>
(),
EXPECT_CALL
(
mock_foo_
,
Decimal
(
true
,
'a'
,
0
,
0
,
1L
,
A
<
float
>
(),
Lt
(
100
),
5U
,
NULL
,
"hi"
))
Lt
(
100
),
5U
,
nullptr
,
"hi"
))
.
WillOnce
(
Return
(
5
));
.
WillOnce
(
Return
(
5
));
EXPECT_EQ
(
5
,
foo_
->
Decimal
(
true
,
'a'
,
0
,
0
,
1
,
0
,
0
,
5
,
nullptr
,
"hi"
));
EXPECT_EQ
(
5
,
foo_
->
Decimal
(
true
,
'a'
,
0
,
0
,
1
,
0
,
0
,
5
,
nullptr
,
"hi"
));
...
@@ -327,10 +327,10 @@ TEST_F(FunctionMockerTest, MocksUnaryFunctionWithCallType) {
...
@@ -327,10 +327,10 @@ TEST_F(FunctionMockerTest, MocksUnaryFunctionWithCallType) {
// Tests mocking a decimal function with calltype.
// Tests mocking a decimal function with calltype.
TEST_F
(
FunctionMockerTest
,
MocksDecimalFunctionWithCallType
)
{
TEST_F
(
FunctionMockerTest
,
MocksDecimalFunctionWithCallType
)
{
EXPECT_CALL
(
mock_foo_
,
CTDecimal
(
true
,
'a'
,
0
,
0
,
1L
,
A
<
float
>
(),
EXPECT_CALL
(
mock_foo_
,
CTDecimal
(
true
,
'a'
,
0
,
0
,
1L
,
A
<
float
>
(),
Lt
(
100
),
5U
,
NULL
,
"hi"
))
Lt
(
100
),
5U
,
nullptr
,
"hi"
))
.
WillOnce
(
Return
(
10
));
.
WillOnce
(
Return
(
10
));
EXPECT_EQ
(
10
,
foo_
->
CTDecimal
(
true
,
'a'
,
0
,
0
,
1
,
0
,
0
,
5
,
NULL
,
"hi"
));
EXPECT_EQ
(
10
,
foo_
->
CTDecimal
(
true
,
'a'
,
0
,
0
,
1
,
0
,
0
,
5
,
nullptr
,
"hi"
));
}
}
// Tests mocking functions overloaded on the const-ness of this object.
// Tests mocking functions overloaded on the const-ness of this object.
...
...
googlemock/test/gmock-matchers_test.cc
View file @
3feffddd
...
@@ -323,7 +323,7 @@ TEST(MatcherTest, CanBeImplicitlyConstructedFromValue) {
...
@@ -323,7 +323,7 @@ TEST(MatcherTest, CanBeImplicitlyConstructedFromValue) {
// Tests that NULL can be used in place of Eq(NULL).
// Tests that NULL can be used in place of Eq(NULL).
TEST
(
MatcherTest
,
CanBeImplicitlyConstructedFromNULL
)
{
TEST
(
MatcherTest
,
CanBeImplicitlyConstructedFromNULL
)
{
Matcher
<
int
*>
m1
=
NULL
;
Matcher
<
int
*>
m1
=
nullptr
;
EXPECT_TRUE
(
m1
.
Matches
(
nullptr
));
EXPECT_TRUE
(
m1
.
Matches
(
nullptr
));
int
n
=
0
;
int
n
=
0
;
EXPECT_FALSE
(
m1
.
Matches
(
&
n
));
EXPECT_FALSE
(
m1
.
Matches
(
&
n
));
...
@@ -4779,8 +4779,8 @@ TEST(IsTrueTest, IsTrueIsFalse) {
...
@@ -4779,8 +4779,8 @@ TEST(IsTrueTest, IsTrueIsFalse) {
EXPECT_THAT
(
false
,
Not
(
IsTrue
()));
EXPECT_THAT
(
false
,
Not
(
IsTrue
()));
EXPECT_THAT
(
0
,
Not
(
IsTrue
()));
EXPECT_THAT
(
0
,
Not
(
IsTrue
()));
EXPECT_THAT
(
0
,
IsFalse
());
EXPECT_THAT
(
0
,
IsFalse
());
EXPECT_THAT
(
NULL
,
Not
(
IsTrue
()));
EXPECT_THAT
(
nullptr
,
Not
(
IsTrue
()));
EXPECT_THAT
(
NULL
,
IsFalse
());
EXPECT_THAT
(
nullptr
,
IsFalse
());
EXPECT_THAT
(
-
1
,
IsTrue
());
EXPECT_THAT
(
-
1
,
IsTrue
());
EXPECT_THAT
(
-
1
,
Not
(
IsFalse
()));
EXPECT_THAT
(
-
1
,
Not
(
IsFalse
()));
EXPECT_THAT
(
1
,
IsTrue
());
EXPECT_THAT
(
1
,
IsTrue
());
...
...
googlemock/test/gmock_link_test.h
View file @
3feffddd
...
@@ -414,7 +414,7 @@ TEST(LinkTest, TestThrow) {
...
@@ -414,7 +414,7 @@ TEST(LinkTest, TestThrow) {
Mock
mock
;
Mock
mock
;
EXPECT_CALL
(
mock
,
VoidFromString
(
_
)).
WillOnce
(
Throw
(
42
));
EXPECT_CALL
(
mock
,
VoidFromString
(
_
)).
WillOnce
(
Throw
(
42
));
EXPECT_THROW
(
mock
.
VoidFromString
(
NULL
),
int
);
EXPECT_THROW
(
mock
.
VoidFromString
(
nullptr
),
int
);
}
}
#endif // GTEST_HAS_EXCEPTIONS
#endif // GTEST_HAS_EXCEPTIONS
...
...
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