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/update_manager/real_updater_provider.cc b/update_manager/real_updater_provider.cc
index c525b8f..004b51a 100644
--- a/update_manager/real_updater_provider.cc
+++ b/update_manager/real_updater_provider.cc
@@ -81,7 +81,7 @@
   const Time* GetValue(TimeDelta /* timeout */, string* errmsg) override {
     GetStatusHelper raw(system_state(), errmsg);
     if (!raw.is_success())
-      return NULL;
+      return nullptr;
 
     return new Time(Time::FromTimeT(raw.last_checked_time()));
   }
@@ -100,14 +100,14 @@
   const double* GetValue(TimeDelta /* timeout */, string* errmsg) override {
     GetStatusHelper raw(system_state(), errmsg);
     if (!raw.is_success())
-      return NULL;
+      return nullptr;
 
     if (raw.progress() < 0.0 || raw.progress() > 1.0) {
       if (errmsg) {
         *errmsg = StringPrintf("Invalid progress value received: %f",
                                raw.progress());
       }
-      return NULL;
+      return nullptr;
     }
 
     return new double(raw.progress());
@@ -154,7 +154,7 @@
                                      string* errmsg) {
   GetStatusHelper raw(system_state(), errmsg);
   if (!raw.is_success())
-    return NULL;
+    return nullptr;
 
   for (auto& key_val : curr_op_str_to_stage)
     if (raw.update_status() == key_val.str)
@@ -162,7 +162,7 @@
 
   if (errmsg)
     *errmsg = string("Unknown update status: ") + raw.update_status();
-  return NULL;
+  return nullptr;
 }
 
 // A variable reporting the version number that an update is updating to.
@@ -175,7 +175,7 @@
   const string* GetValue(TimeDelta /* timeout */, string* errmsg) override {
     GetStatusHelper raw(system_state(), errmsg);
     if (!raw.is_success())
-      return NULL;
+      return nullptr;
 
     return new string(raw.new_version());
   }
@@ -193,12 +193,12 @@
   const int64_t* GetValue(TimeDelta /* timeout */, string* errmsg) override {
     GetStatusHelper raw(system_state(), errmsg);
     if (!raw.is_success())
-      return NULL;
+      return nullptr;
 
     if (raw.payload_size() < 0) {
       if (errmsg)
         *errmsg = string("Invalid payload size: %" PRId64, raw.payload_size());
-      return NULL;
+      return nullptr;
     }
 
     return new int64_t(raw.payload_size());
@@ -226,7 +226,7 @@
             &update_boottime)) {
       if (errmsg)
         *errmsg = "Update completed time could not be read";
-      return NULL;
+      return nullptr;
     }
 
     chromeos_update_engine::ClockInterface* clock = system_state()->clock();
@@ -234,7 +234,7 @@
     if (curr_boottime < update_boottime) {
       if (errmsg)
         *errmsg = "Update completed time more recent than current time";
-      return NULL;
+      return nullptr;
     }
     TimeDelta duration_since_update = curr_boottime - update_boottime;
     return new Time(clock->GetWallclockTime() - duration_since_update);
@@ -256,7 +256,7 @@
     if (channel.empty()) {
       if (errmsg)
         *errmsg = "No current channel";
-      return NULL;
+      return nullptr;
     }
     return new string(channel);
   }
@@ -277,7 +277,7 @@
     if (channel.empty()) {
       if (errmsg)
         *errmsg = "No new channel";
-      return NULL;
+      return nullptr;
     }
     return new string(channel);
   }
@@ -300,7 +300,7 @@
     if (prefs && prefs->Exists(key_) && !prefs->GetBoolean(key_, &result)) {
       if (errmsg)
         *errmsg = string("Could not read boolean pref ") + key_;
-      return NULL;
+      return nullptr;
     }
     return new bool(result);
   }