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

Side by Side Diff: test/unittests/base/iterator-unittest.cc

Issue 2834293002: Avoid signed/unsigned warning in VC++ 2017 builds (Closed)
Patch Set: Avoid signed/unsigned warning in VC++ 2017 builds Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project 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 "src/base/iterator.h" 5 #include "src/base/iterator.h"
6 6
7 #include <deque> 7 #include <deque>
8 8
9 #include "test/unittests/test-utils.h" 9 #include "test/unittests/test-utils.h"
10 10
(...skipping 24 matching lines...) Expand all
35 base::iterator_range<int*> r2(&array[0], &array[0]); 35 base::iterator_range<int*> r2(&array[0], &array[0]);
36 EXPECT_EQ(0, r2.size()); 36 EXPECT_EQ(0, r2.size());
37 EXPECT_TRUE(r2.empty()); 37 EXPECT_TRUE(r2.empty());
38 for (auto i : array) { 38 for (auto i : array) {
39 EXPECT_EQ(r2.end(), std::find(r2.begin(), r2.end(), i)); 39 EXPECT_EQ(r2.end(), std::find(r2.begin(), r2.end(), i));
40 } 40 }
41 } 41 }
42 42
43 43
44 TEST(IteratorTest, IteratorRangeDeque) { 44 TEST(IteratorTest, IteratorRangeDeque) {
45 typedef std::deque<unsigned> C; 45 typedef std::deque<int> C;
46 C c; 46 C c;
47 c.push_back(1); 47 c.push_back(1);
48 c.push_back(2); 48 c.push_back(2);
49 c.push_back(2); 49 c.push_back(2);
50 base::iterator_range<typename C::iterator> r(c.begin(), c.end()); 50 base::iterator_range<typename C::iterator> r(c.begin(), c.end());
51 EXPECT_EQ(3, r.size()); 51 EXPECT_EQ(3, r.size());
52 EXPECT_FALSE(r.empty()); 52 EXPECT_FALSE(r.empty());
53 EXPECT_TRUE(c.begin() == r.begin()); 53 EXPECT_TRUE(c.begin() == r.begin());
54 EXPECT_TRUE(c.end() == r.end()); 54 EXPECT_TRUE(c.end() == r.end());
55 EXPECT_EQ(0, std::count(r.begin(), r.end(), 0)); 55 EXPECT_EQ(0, std::count(r.begin(), r.end(), 0));
56 EXPECT_EQ(1, std::count(r.begin(), r.end(), 1)); 56 EXPECT_EQ(1, std::count(r.begin(), r.end(), 1));
57 EXPECT_EQ(2, std::count(r.begin(), r.end(), 2)); 57 EXPECT_EQ(2, std::count(r.begin(), r.end(), 2));
58 } 58 }
59 59
60 } // namespace base 60 } // namespace base
61 } // namespace v8 61 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698