update_engine: Replace NULL with nullptr
Replaced the usage of NULL with nullptr. This also makes it possible to
use standard gtest macros to compare pointers in Update Manager's unit tests.
So, there is no need in custom UMTEST_... macros which are replaced with the
gtest macros (see change in update_engine/update_manager/umtest_utils.h):
UMTEST_ASSERT_NULL(p) => ASSERT_EQ(nullptr, p)
UMTEST_ASSERT_NOT_NULL(p) => ASSERT_NE(nullptr, p)
UMTEST_EXPECT_NULL(p) => EXPECT_EQ(nullptr, p)
UMTEST_EXPECT_NOT_NULL(p) => EXPECT_NE(nullptr, p)
BUG=None
TEST=FEATURES=test emerge-link update_engine
USE="clang asan" FEATURES=test emerge-link update_engine
Change-Id: I77a42a1e9ce992bb2f9f263db5cf75fe6110a4ec
Reviewed-on: https://chromium-review.googlesource.com/215136
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/omaha_request_action.h b/omaha_request_action.h
index 0dc3d9f..a4d9fdf 100644
--- a/omaha_request_action.h
+++ b/omaha_request_action.h
@@ -112,14 +112,14 @@
//
// Takes ownership of the passed in HttpFetcher. Useful for testing.
//
- // Takes ownership of the passed in OmahaEvent. If |event| is NULL,
+ // Takes ownership of the passed in OmahaEvent. If |event| is null,
// this is an UpdateCheck request, otherwise it's an Event request.
// Event requests always succeed.
//
// A good calling pattern is:
// OmahaRequestAction(..., new OmahaEvent(...), new WhateverHttpFetcher);
// or
- // OmahaRequestAction(..., NULL, new WhateverHttpFetcher);
+ // OmahaRequestAction(..., nullptr, new WhateverHttpFetcher);
OmahaRequestAction(SystemState* system_state,
OmahaEvent* event,
HttpFetcher* http_fetcher,
@@ -143,7 +143,7 @@
virtual void TransferComplete(HttpFetcher *fetcher, bool successful);
// Returns true if this is an Event request, false if it's an UpdateCheck.
- bool IsEvent() const { return event_.get() != NULL; }
+ bool IsEvent() const { return event_.get() != nullptr; }
private:
FRIEND_TEST(OmahaRequestActionTest, GetInstallDate);
@@ -264,7 +264,7 @@
// Contains state that is relevant in the processing of the Omaha request.
OmahaRequestParams* params_;
- // Pointer to the OmahaEvent info. This is an UpdateCheck request if NULL.
+ // Pointer to the OmahaEvent info. This is an UpdateCheck request if null.
scoped_ptr<OmahaEvent> event_;
// pointer to the HttpFetcher that does the http work