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

Side by Side Diff: base/memory/scoped_vector_unittest.cc

Issue 2625903003: Update scoped_ptr references to be unique_ptr in src/base comments. (Closed)
Patch Set: spelling fix Created 3 years, 11 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
« no previous file with comments | « base/memory/linked_ptr.h ('k') | base/message_loop/message_pump_glib.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/memory/scoped_vector.h" 5 #include "base/memory/scoped_vector.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 } 315 }
316 for(LifeCycleWatcher* it = watchers; it != watchers + 1; ++it) 316 for(LifeCycleWatcher* it = watchers; it != watchers + 1; ++it)
317 EXPECT_EQ(LC_CONSTRUCTED, it->life_cycle_state()); 317 EXPECT_EQ(LC_CONSTRUCTED, it->life_cycle_state());
318 for(LifeCycleWatcher* it = watchers + 1; it != watchers + 3; ++it) 318 for(LifeCycleWatcher* it = watchers + 1; it != watchers + 3; ++it)
319 EXPECT_EQ(LC_DESTROYED, it->life_cycle_state()); 319 EXPECT_EQ(LC_DESTROYED, it->life_cycle_state());
320 for(LifeCycleWatcher* it = watchers + 3; it != watchers + arraysize(watchers); 320 for(LifeCycleWatcher* it = watchers + 3; it != watchers + arraysize(watchers);
321 ++it) 321 ++it)
322 EXPECT_EQ(LC_CONSTRUCTED, it->life_cycle_state()); 322 EXPECT_EQ(LC_CONSTRUCTED, it->life_cycle_state());
323 } 323 }
324 324
325 // Assertions for push_back(scoped_ptr). 325 // Assertions for push_back(unique_ptr).
326 TEST(ScopedVectorTest, PushBackScopedPtr) { 326 TEST(ScopedVectorTest, PushBackScopedPtr) {
327 int delete_counter = 0; 327 int delete_counter = 0;
328 std::unique_ptr<DeleteCounter> elem(new DeleteCounter(&delete_counter)); 328 std::unique_ptr<DeleteCounter> elem(new DeleteCounter(&delete_counter));
329 EXPECT_EQ(0, delete_counter); 329 EXPECT_EQ(0, delete_counter);
330 { 330 {
331 ScopedVector<DeleteCounter> v; 331 ScopedVector<DeleteCounter> v;
332 v.push_back(std::move(elem)); 332 v.push_back(std::move(elem));
333 EXPECT_EQ(0, delete_counter); 333 EXPECT_EQ(0, delete_counter);
334 } 334 }
335 EXPECT_EQ(1, delete_counter); 335 EXPECT_EQ(1, delete_counter);
336 } 336 }
337 337
338 } // namespace 338 } // namespace
OLDNEW
« no previous file with comments | « base/memory/linked_ptr.h ('k') | base/message_loop/message_pump_glib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698