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

Unified Diff: base/pickle_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/metrics/statistics_recorder_unittest.cc ('k') | base/power_monitor/power_monitor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/pickle_unittest.cc
diff --git a/base/pickle_unittest.cc b/base/pickle_unittest.cc
index 307cb5134da04011b132c0a2623ae27c0254239c..e00edd9e03142b4dbc4509abc06df4062614327a 100644
--- a/base/pickle_unittest.cc
+++ b/base/pickle_unittest.cc
@@ -2,15 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/pickle.h"
+
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <string>
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/pickle.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -163,7 +164,7 @@ TEST(PickleTest, LongFrom64Bit) {
// Tests that we can handle really small buffers.
TEST(PickleTest, SmallBuffer) {
- scoped_ptr<char[]> buffer(new char[1]);
+ std::unique_ptr<char[]> buffer(new char[1]);
// We should not touch the buffer.
Pickle pickle(buffer.get(), 1);
@@ -329,7 +330,7 @@ TEST(PickleTest, FindNext) {
TEST(PickleTest, FindNextWithIncompleteHeader) {
size_t header_size = sizeof(Pickle::Header);
- scoped_ptr<char[]> buffer(new char[header_size - 1]);
+ std::unique_ptr<char[]> buffer(new char[header_size - 1]);
memset(buffer.get(), 0x1, header_size - 1);
const char* start = buffer.get();
@@ -346,7 +347,7 @@ TEST(PickleTest, FindNextOverflow) {
size_t header_size = sizeof(Pickle::Header);
size_t header_size2 = 2 * header_size;
size_t payload_received = 100;
- scoped_ptr<char[]> buffer(new char[header_size2 + payload_received]);
+ std::unique_ptr<char[]> buffer(new char[header_size2 + payload_received]);
const char* start = buffer.get();
Pickle::Header* header = reinterpret_cast<Pickle::Header*>(buffer.get());
const char* end = start + header_size2 + payload_received;
@@ -390,7 +391,7 @@ TEST(PickleTest, GetReadPointerAndAdvance) {
TEST(PickleTest, Resize) {
size_t unit = Pickle::kPayloadUnit;
- scoped_ptr<char[]> data(new char[unit]);
+ std::unique_ptr<char[]> data(new char[unit]);
char* data_ptr = data.get();
for (size_t i = 0; i < unit; i++)
data_ptr[i] = 'G';
« no previous file with comments | « base/metrics/statistics_recorder_unittest.cc ('k') | base/power_monitor/power_monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698