Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2436)

Unified Diff: base/files/memory_mapped_file_unittest.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/files/important_file_writer_unittest.cc ('k') | base/files/scoped_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/memory_mapped_file_unittest.cc
diff --git a/base/files/memory_mapped_file_unittest.cc b/base/files/memory_mapped_file_unittest.cc
index f75686f74bf43a144990a24ec7beb72dcda899aa..396ab72fbcb91a71795704747d130f6f0fb569cb 100644
--- a/base/files/memory_mapped_file_unittest.cc
+++ b/base/files/memory_mapped_file_unittest.cc
@@ -19,8 +19,8 @@ namespace base {
namespace {
// Create a temporary buffer and fill it with a watermark sequence.
-scoped_ptr<uint8_t[]> CreateTestBuffer(size_t size, size_t offset) {
- scoped_ptr<uint8_t[]> buf(new uint8_t[size]);
+std::unique_ptr<uint8_t[]> CreateTestBuffer(size_t size, size_t offset) {
+ std::unique_ptr<uint8_t[]> buf(new uint8_t[size]);
for (size_t i = 0; i < size; ++i)
buf.get()[i] = static_cast<uint8_t>((offset + i) % 253);
return buf;
@@ -28,7 +28,7 @@ scoped_ptr<uint8_t[]> CreateTestBuffer(size_t size, size_t offset) {
// Check that the watermark sequence is consistent with the |offset| provided.
bool CheckBufferContents(const uint8_t* data, size_t size, size_t offset) {
- scoped_ptr<uint8_t[]> test_data(CreateTestBuffer(size, offset));
+ std::unique_ptr<uint8_t[]> test_data(CreateTestBuffer(size, offset));
return memcmp(test_data.get(), data, size) == 0;
}
@@ -46,7 +46,7 @@ class MemoryMappedFileTest : public PlatformTest {
File::FLAG_CREATE_ALWAYS | File::FLAG_READ | File::FLAG_WRITE);
EXPECT_TRUE(file.IsValid());
- scoped_ptr<uint8_t[]> test_data(CreateTestBuffer(size, 0));
+ std::unique_ptr<uint8_t[]> test_data(CreateTestBuffer(size, 0));
size_t bytes_written =
file.Write(0, reinterpret_cast<char*>(test_data.get()), size);
EXPECT_EQ(size, bytes_written);
« no previous file with comments | « base/files/important_file_writer_unittest.cc ('k') | base/files/scoped_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698