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

Side by Side Diff: sync/internal_api/public/util/proto_value_ptr_unittest.cc

Issue 1866243002: Convert //sync from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/internal_api/public/util/proto_value_ptr.h" 5 #include "sync/internal_api/public/util/proto_value_ptr.h"
6 6
7 #include <memory>
7 #include <utility> 8 #include <utility>
8 9
9 #include "base/macros.h" 10 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace syncer { 13 namespace syncer {
14 14
15 namespace { 15 namespace {
16 16
17 // Simple test struct that wraps an integer 17 // Simple test struct that wraps an integer
18 struct IntValue { 18 struct IntValue {
19 public: 19 public:
20 explicit IntValue(int value) { value_ = value; } 20 explicit IntValue(int value) { value_ = value; }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 static TestValue default_instance; 92 static TestValue default_instance;
93 default_instance.is_default_ = true; 93 default_instance.is_default_ = true;
94 return default_instance; 94 return default_instance;
95 } 95 }
96 96
97 private: 97 private:
98 static int g_copy_count; 98 static int g_copy_count;
99 static int g_parse_count; 99 static int g_parse_count;
100 static int g_delete_count; 100 static int g_delete_count;
101 101
102 scoped_ptr<IntValue> value_; 102 std::unique_ptr<IntValue> value_;
103 bool is_default_; 103 bool is_default_;
104 104
105 DISALLOW_COPY_AND_ASSIGN(TestValue); 105 DISALLOW_COPY_AND_ASSIGN(TestValue);
106 }; 106 };
107 107
108 // Static initializers. 108 // Static initializers.
109 int TestValue::g_copy_count = 0; 109 int TestValue::g_copy_count = 0;
110 int TestValue::g_parse_count = 0; 110 int TestValue::g_parse_count = 0;
111 int TestValue::g_delete_count = 0; 111 int TestValue::g_delete_count = 0;
112 112
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 EXPECT_EQ(1, TestValue::parse_count()); 239 EXPECT_EQ(1, TestValue::parse_count());
240 EXPECT_EQ(0, TestValue::copy_count()); 240 EXPECT_EQ(0, TestValue::copy_count());
241 241
242 EXPECT_EQ(v1, ptr1->value()); 242 EXPECT_EQ(v1, ptr1->value());
243 } 243 }
244 244
245 EXPECT_EQ(1, TestValue::delete_count()); 245 EXPECT_EQ(1, TestValue::delete_count());
246 } 246 }
247 247
248 } // namespace syncer 248 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698