diff options
author | Ben Chan <benchan@chromium.org> | 2014-10-18 15:18:02 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-21 00:44:38 +0000 |
commit | 02f7c1dee242f490143791dbb73fa23fa3007cfa (patch) | |
tree | 23b466db253d05dfa3d05c0c978c6b156c751e58 /update_manager/generic_variables_unittest.cc | |
parent | ef8d08712d01c23d31e27000519cbdeb88f60b73 (diff) |
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>
Diffstat (limited to 'update_manager/generic_variables_unittest.cc')
-rw-r--r-- | update_manager/generic_variables_unittest.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/update_manager/generic_variables_unittest.cc b/update_manager/generic_variables_unittest.cc index 634acce5..f0ea60c8 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 @@ TEST_F(UmPollCopyVariableTest, SimpleTest) { 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 @@ TEST_F(UmPollCopyVariableTest, UseCopyConstructorTest) { 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_F(UmCallCopyVariableTest, SimpleTest) { 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()); |