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

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

Issue 611153004: replace OVERRIDE and FINAL with override and final in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CC_ -> BASE_ Created 6 years, 2 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/discardable_memory_manager_unittest.cc ('k') | base/memory/ref_counted_memory.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 <string> 5 #include <string>
6 6
7 #include "base/memory/linked_ptr.h" 7 #include "base/memory/linked_ptr.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace { 11 namespace {
12 12
13 int num = 0; 13 int num = 0;
14 14
15 std::string history; 15 std::string history;
16 16
17 // Class which tracks allocation/deallocation 17 // Class which tracks allocation/deallocation
18 struct A { 18 struct A {
19 A(): mynum(num++) { history += base::StringPrintf("A%d ctor\n", mynum); } 19 A(): mynum(num++) { history += base::StringPrintf("A%d ctor\n", mynum); }
20 virtual ~A() { history += base::StringPrintf("A%d dtor\n", mynum); } 20 virtual ~A() { history += base::StringPrintf("A%d dtor\n", mynum); }
21 virtual void Use() { history += base::StringPrintf("A%d use\n", mynum); } 21 virtual void Use() { history += base::StringPrintf("A%d use\n", mynum); }
22 int mynum; 22 int mynum;
23 }; 23 };
24 24
25 // Subclass 25 // Subclass
26 struct B: public A { 26 struct B: public A {
27 B() { history += base::StringPrintf("B%d ctor\n", mynum); } 27 B() { history += base::StringPrintf("B%d ctor\n", mynum); }
28 virtual ~B() { history += base::StringPrintf("B%d dtor\n", mynum); } 28 virtual ~B() { history += base::StringPrintf("B%d dtor\n", mynum); }
29 virtual void Use() OVERRIDE { 29 virtual void Use() override {
30 history += base::StringPrintf("B%d use\n", mynum); 30 history += base::StringPrintf("B%d use\n", mynum);
31 } 31 }
32 }; 32 };
33 33
34 } // namespace 34 } // namespace
35 35
36 TEST(LinkedPtrTest, Test) { 36 TEST(LinkedPtrTest, Test) {
37 { 37 {
38 linked_ptr<A> a0, a1, a2; 38 linked_ptr<A> a0, a1, a2;
39 a0 = a0; 39 a0 = a0;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 "A2 dtor\n" 101 "A2 dtor\n"
102 "A0 use\n" 102 "A0 use\n"
103 "A0 use\n" 103 "A0 use\n"
104 "A1 use\n" 104 "A1 use\n"
105 "A3 ctor\n" 105 "A3 ctor\n"
106 "A0 dtor\n" 106 "A0 dtor\n"
107 "A3 dtor\n" 107 "A3 dtor\n"
108 "A1 dtor\n" 108 "A1 dtor\n"
109 ); 109 );
110 } 110 }
OLDNEW
« no previous file with comments | « base/memory/discardable_memory_manager_unittest.cc ('k') | base/memory/ref_counted_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698