Index: base/containers/scoped_ptr_hash_map_unittest.cc |
diff --git a/base/containers/scoped_ptr_hash_map_unittest.cc b/base/containers/scoped_ptr_hash_map_unittest.cc |
index 38fc91a3840967086d3515d94cc38e0d453613bc..eddabafd2f6cff160bdedd212d0be89a2f11dcfe 100644 |
--- a/base/containers/scoped_ptr_hash_map_unittest.cc |
+++ b/base/containers/scoped_ptr_hash_map_unittest.cc |
@@ -4,7 +4,9 @@ |
#include "base/containers/scoped_ptr_hash_map.h" |
-#include "base/memory/scoped_ptr.h" |
+#include <memory> |
+ |
+#include "base/memory/ptr_util.h" |
#include "testing/gtest/include/gtest/gtest.h" |
namespace base { |
@@ -56,8 +58,9 @@ TEST(ScopedPtrHashMapTest, CustomDeleter) { |
DeleteCounter::ResetCounter(); |
CountingDeleter::ResetCounter(); |
{ |
- ScopedPtrHashMap<int, scoped_ptr<DeleteCounter, CountingDeleter>> map; |
- map.set(key, scoped_ptr<DeleteCounter, CountingDeleter>(new DeleteCounter)); |
+ ScopedPtrHashMap<int, std::unique_ptr<DeleteCounter, CountingDeleter>> map; |
+ map.set(key, |
+ std::unique_ptr<DeleteCounter, CountingDeleter>(new DeleteCounter)); |
} |
EXPECT_EQ(1, DeleteCounter::delete_count()); |
EXPECT_EQ(1, CountingDeleter::count()); |
@@ -66,9 +69,9 @@ TEST(ScopedPtrHashMapTest, CustomDeleter) { |
DeleteCounter::ResetCounter(); |
CountingDeleter::ResetCounter(); |
{ |
- ScopedPtrHashMap<int, scoped_ptr<DeleteCounter, CountingDeleter>> map; |
- map.erase(map.set( |
- key, scoped_ptr<DeleteCounter, CountingDeleter>(new DeleteCounter))); |
+ ScopedPtrHashMap<int, std::unique_ptr<DeleteCounter, CountingDeleter>> map; |
+ map.erase(map.set(key, std::unique_ptr<DeleteCounter, CountingDeleter>( |
+ new DeleteCounter))); |
EXPECT_EQ(1, DeleteCounter::delete_count()); |
EXPECT_EQ(1, CountingDeleter::count()); |
} |
@@ -79,10 +82,13 @@ TEST(ScopedPtrHashMapTest, CustomDeleter) { |
DeleteCounter::ResetCounter(); |
CountingDeleter::ResetCounter(); |
{ |
- ScopedPtrHashMap<int, scoped_ptr<DeleteCounter, CountingDeleter>> map; |
- map.set(key, scoped_ptr<DeleteCounter, CountingDeleter>(new DeleteCounter)); |
- map.set(key, scoped_ptr<DeleteCounter, CountingDeleter>(new DeleteCounter)); |
- map.set(key, scoped_ptr<DeleteCounter, CountingDeleter>(new DeleteCounter)); |
+ ScopedPtrHashMap<int, std::unique_ptr<DeleteCounter, CountingDeleter>> map; |
+ map.set(key, |
+ std::unique_ptr<DeleteCounter, CountingDeleter>(new DeleteCounter)); |
+ map.set(key, |
+ std::unique_ptr<DeleteCounter, CountingDeleter>(new DeleteCounter)); |
+ map.set(key, |
+ std::unique_ptr<DeleteCounter, CountingDeleter>(new DeleteCounter)); |
EXPECT_EQ(2, DeleteCounter::delete_count()); |
EXPECT_EQ(2, CountingDeleter::count()); |
} |
@@ -93,9 +99,9 @@ TEST(ScopedPtrHashMapTest, CustomDeleter) { |
// Test that using a value type from a namespace containing an ignore_result |
// function compiles correctly. |
TEST(ScopedPtrHashMapTest, IgnoreResultCompile) { |
- ScopedPtrHashMap<int, scoped_ptr<namespace_with_ignore_result::Value>> |
+ ScopedPtrHashMap<int, std::unique_ptr<namespace_with_ignore_result::Value>> |
scoped_map; |
- scoped_map.add(1, make_scoped_ptr(new namespace_with_ignore_result::Value)); |
+ scoped_map.add(1, WrapUnique(new namespace_with_ignore_result::Value)); |
} |
} // namespace |