update_engine: Replace scoped_ptr with std::unique_ptr.
BUG=None
TEST=`FEATURES=test emerge-$BOARD update_engine`
TEST=`USE='clang asan' FEATURES=test emerge-$BOARD update_engine`
Change-Id: I55a2f7f53675faaac20ba25f72ed52cf938d7744
Reviewed-on: https://chromium-review.googlesource.com/224189
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
diff --git a/update_manager/generic_variables_unittest.cc b/update_manager/generic_variables_unittest.cc
index 634acce..f0ea60c 100644
--- a/update_manager/generic_variables_unittest.cc
+++ b/update_manager/generic_variables_unittest.cc
@@ -4,8 +4,9 @@
#include "update_engine/update_manager/generic_variables.h"
+#include <memory>
+
#include <base/callback.h>
-#include <base/memory/scoped_ptr.h>
#include <gtest/gtest.h>
#include "update_engine/test_utils.h"
@@ -13,6 +14,7 @@
using base::TimeDelta;
using chromeos_update_engine::RunGMainLoopMaxIterations;
+using std::unique_ptr;
namespace chromeos_update_manager {
@@ -25,7 +27,7 @@
PollCopyVariable<int> var("var", source);
// Generate and validate a copy.
- scoped_ptr<const int> copy_1(var.GetValue(
+ unique_ptr<const int> copy_1(var.GetValue(
UmTestUtils::DefaultTimeout(), nullptr));
ASSERT_NE(nullptr, copy_1.get());
EXPECT_EQ(5, *copy_1);
@@ -75,7 +77,7 @@
ASSERT_FALSE(source.copied_);
PollCopyVariable<CopyConstructorTestClass> var("var", source);
- scoped_ptr<const CopyConstructorTestClass> copy(
+ unique_ptr<const CopyConstructorTestClass> copy(
var.GetValue(UmTestUtils::DefaultTimeout(), nullptr));
ASSERT_NE(nullptr, copy.get());
EXPECT_TRUE(copy->copied_);
@@ -114,7 +116,7 @@
test_func, &test_obj);
CallCopyVariable<CopyConstructorTestClass> var("var", cb);
- scoped_ptr<const CopyConstructorTestClass> copy(
+ unique_ptr<const CopyConstructorTestClass> copy(
var.GetValue(UmTestUtils::DefaultTimeout(), nullptr));
EXPECT_EQ(6, test_obj.val_); // Check that the function was called.
ASSERT_NE(nullptr, copy.get());