diff options
author | Gennadiy Civil <misterg@google.com> | 2018-10-29 17:46:24 (GMT) |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2018-10-29 17:46:24 (GMT) |
commit | e9085769d4819f8491a5ab19e9e3813144e6aa13 (patch) | |
tree | 55a2496790bc46370f84234d179db810926a6d95 /googlemock | |
parent | 80b43d900b8ed44e16b306682d47d73175cecc7f (diff) | |
parent | 3feffddd1e8381209a48c24587e36e030051499f (diff) | |
download | googletest-e9085769d4819f8491a5ab19e9e3813144e6aa13.zip googletest-e9085769d4819f8491a5ab19e9e3813144e6aa13.tar.gz googletest-e9085769d4819f8491a5ab19e9e3813144e6aa13.tar.bz2 |
Merge pull request #1941 from barkovv:master
PiperOrigin-RevId: 219134349
Diffstat (limited to 'googlemock')
-rw-r--r-- | googlemock/include/gmock/gmock-spec-builders.h | 5 | ||||
-rw-r--r-- | googlemock/src/gmock-spec-builders.cc | 4 | ||||
-rw-r--r-- | googlemock/test/gmock-generated-function-mockers_test.cc | 10 | ||||
-rw-r--r-- | googlemock/test/gmock-matchers_test.cc | 6 | ||||
-rw-r--r-- | googlemock/test/gmock_link_test.h | 2 |
5 files changed, 14 insertions, 13 deletions
diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h index 7759cb3..c0df5cc 100644 --- a/googlemock/include/gmock/gmock-spec-builders.h +++ b/googlemock/include/gmock/gmock-spec-builders.h @@ -1904,8 +1904,9 @@ GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 // second argument is an internal type derived from the method signature. The // failure to disambiguate two overloads of this method in the ON_CALL statement // is how we block callers from setting expectations on overloaded methods. -#define GMOCK_ON_CALL_IMPL_(mock_expr, Setter, call) \ - ((mock_expr).gmock_##call)(::testing::internal::GetWithoutMatchers(), NULL) \ +#define GMOCK_ON_CALL_IMPL_(mock_expr, Setter, call) \ + ((mock_expr).gmock_##call)(::testing::internal::GetWithoutMatchers(), \ + nullptr) \ .Setter(__FILE__, __LINE__, #mock_expr, #call) #define ON_CALL(obj, call) \ diff --git a/googlemock/src/gmock-spec-builders.cc b/googlemock/src/gmock-spec-builders.cc index c93b2b5..e8b51f6 100644 --- a/googlemock/src/gmock-spec-builders.cc +++ b/googlemock/src/gmock-spec-builders.cc @@ -867,7 +867,7 @@ void Sequence::AddExpectation(const Expectation& expectation) const { // Creates the implicit sequence if there isn't one. 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); sequence_created_ = true; } else { @@ -880,7 +880,7 @@ InSequence::InSequence() { InSequence::~InSequence() { if (sequence_created_) { delete internal::g_gmock_implicit_sequence.get(); - internal::g_gmock_implicit_sequence.set(NULL); + internal::g_gmock_implicit_sequence.set(nullptr); } } diff --git a/googlemock/test/gmock-generated-function-mockers_test.cc b/googlemock/test/gmock-generated-function-mockers_test.cc index 820a2b6..02c4203 100644 --- a/googlemock/test/gmock-generated-function-mockers_test.cc +++ b/googlemock/test/gmock-generated-function-mockers_test.cc @@ -224,8 +224,8 @@ TEST_F(FunctionMockerTest, MocksBinaryFunction) { // Tests mocking a decimal function. TEST_F(FunctionMockerTest, MocksDecimalFunction) { - EXPECT_CALL(mock_foo_, Decimal(true, 'a', 0, 0, 1L, A<float>(), - Lt(100), 5U, NULL, "hi")) + EXPECT_CALL(mock_foo_, Decimal(true, 'a', 0, 0, 1L, A<float>(), Lt(100), 5U, + nullptr, "hi")) .WillOnce(Return(5)); EXPECT_EQ(5, foo_->Decimal(true, 'a', 0, 0, 1, 0, 0, 5, nullptr, "hi")); @@ -326,11 +326,11 @@ TEST_F(FunctionMockerTest, MocksUnaryFunctionWithCallType) { // Tests mocking a decimal function with calltype. TEST_F(FunctionMockerTest, MocksDecimalFunctionWithCallType) { - EXPECT_CALL(mock_foo_, CTDecimal(true, 'a', 0, 0, 1L, A<float>(), - Lt(100), 5U, NULL, "hi")) + EXPECT_CALL(mock_foo_, CTDecimal(true, 'a', 0, 0, 1L, A<float>(), Lt(100), 5U, + nullptr, "hi")) .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. diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc index 45006bf..6f04248 100644 --- a/googlemock/test/gmock-matchers_test.cc +++ b/googlemock/test/gmock-matchers_test.cc @@ -321,7 +321,7 @@ TEST(MatcherTest, CanBeImplicitlyConstructedFromValue) { // Tests that NULL can be used in place of Eq(NULL). TEST(MatcherTest, CanBeImplicitlyConstructedFromNULL) { - Matcher<int*> m1 = NULL; + Matcher<int*> m1 = nullptr; EXPECT_TRUE(m1.Matches(nullptr)); int n = 0; EXPECT_FALSE(m1.Matches(&n)); @@ -4759,8 +4759,8 @@ TEST(IsTrueTest, IsTrueIsFalse) { EXPECT_THAT(false, Not(IsTrue())); EXPECT_THAT(0, Not(IsTrue())); EXPECT_THAT(0, IsFalse()); - EXPECT_THAT(NULL, Not(IsTrue())); - EXPECT_THAT(NULL, IsFalse()); + EXPECT_THAT(nullptr, Not(IsTrue())); + EXPECT_THAT(nullptr, IsFalse()); EXPECT_THAT(-1, IsTrue()); EXPECT_THAT(-1, Not(IsFalse())); EXPECT_THAT(1, IsTrue()); diff --git a/googlemock/test/gmock_link_test.h b/googlemock/test/gmock_link_test.h index e85f750..175d2bd 100644 --- a/googlemock/test/gmock_link_test.h +++ b/googlemock/test/gmock_link_test.h @@ -414,7 +414,7 @@ TEST(LinkTest, TestThrow) { Mock mock; EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Throw(42)); - EXPECT_THROW(mock.VoidFromString(NULL), int); + EXPECT_THROW(mock.VoidFromString(nullptr), int); } #endif // GTEST_HAS_EXCEPTIONS |