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

Side by Side Diff: cc/base/scoped_ptr_vector_unittest.cc

Issue 632613002: [C++11 Allowed Features] Declares a type-safe null pointer converting from NULL to nullptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « cc/base/scoped_ptr_vector.h ('k') | cc/base/swap_promise_monitor.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 <set> 5 #include <set>
6 6
7 #include "cc/base/scoped_ptr_vector.h" 7 #include "cc/base/scoped_ptr_vector.h"
8 #include "testing/gmock/include/gmock/gmock.h" 8 #include "testing/gmock/include/gmock/gmock.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 EXPECT_EQ(6u, v.size()); 64 EXPECT_EQ(6u, v.size());
65 EXPECT_EQ(1, v[0]->data()); 65 EXPECT_EQ(1, v[0]->data());
66 EXPECT_EQ(2, v[1]->data()); 66 EXPECT_EQ(2, v[1]->data());
67 EXPECT_EQ(3, v[2]->data()); 67 EXPECT_EQ(3, v[2]->data());
68 EXPECT_EQ(4, v[3]->data()); 68 EXPECT_EQ(4, v[3]->data());
69 EXPECT_EQ(5, v[4]->data()); 69 EXPECT_EQ(5, v[4]->data());
70 EXPECT_EQ(6, v[5]->data()); 70 EXPECT_EQ(6, v[5]->data());
71 71
72 EXPECT_EQ(3u, v2.size()); 72 EXPECT_EQ(3u, v2.size());
73 EXPECT_EQ(NULL, v2[0]); 73 EXPECT_EQ(nullptr, v2[0]);
74 EXPECT_EQ(NULL, v2[1]); 74 EXPECT_EQ(nullptr, v2[1]);
75 EXPECT_EQ(NULL, v2[2]); 75 EXPECT_EQ(nullptr, v2[2]);
76 } 76 }
77 77
78 TEST(ScopedPtrVectorTest, Partition) { 78 TEST(ScopedPtrVectorTest, Partition) {
79 ScopedPtrVector<Data> v; 79 ScopedPtrVector<Data> v;
80 v.push_back(Data::Create(1)); 80 v.push_back(Data::Create(1));
81 v.push_back(Data::Create(2)); 81 v.push_back(Data::Create(2));
82 v.push_back(Data::Create(3)); 82 v.push_back(Data::Create(3));
83 v.push_back(Data::Create(4)); 83 v.push_back(Data::Create(4));
84 v.push_back(Data::Create(5)); 84 v.push_back(Data::Create(5));
85 85
(...skipping 10 matching lines...) Expand all
96 std::set<int> even_numbers; 96 std::set<int> even_numbers;
97 for (; it != v.end(); ++it) { 97 for (; it != v.end(); ++it) {
98 EXPECT_EQ(0, (*it)->data() % 2); 98 EXPECT_EQ(0, (*it)->data() % 2);
99 even_numbers.insert((*it)->data()); 99 even_numbers.insert((*it)->data());
100 } 100 }
101 EXPECT_EQ(2u, even_numbers.size()); 101 EXPECT_EQ(2u, even_numbers.size());
102 } 102 }
103 103
104 } // namespace 104 } // namespace
105 } // namespace cc 105 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/scoped_ptr_vector.h ('k') | cc/base/swap_promise_monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698