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

Side by Side Diff: base/stl_util_unittest.cc

Issue 2821313002: Use std::begin() and std::end() in base::ContainsValue() (Closed)
Patch Set: 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 | « base/stl_util.h ('k') | 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 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 "base/stl_util.h" 5 #include "base/stl_util.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <forward_list> 8 #include <forward_list>
9 #include <functional> 9 #include <functional>
10 #include <iterator> 10 #include <iterator>
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 } 412 }
413 413
414 TEST(Erase, UnorderedSet) { 414 TEST(Erase, UnorderedSet) {
415 RunEraseIfTest<std::unordered_set<std::pair<int, int>, HashByFirst>>(); 415 RunEraseIfTest<std::unordered_set<std::pair<int, int>, HashByFirst>>();
416 } 416 }
417 417
418 TEST(Erase, UnorderedMultiset) { 418 TEST(Erase, UnorderedMultiset) {
419 RunEraseIfTest<std::unordered_multiset<std::pair<int, int>, HashByFirst>>(); 419 RunEraseIfTest<std::unordered_multiset<std::pair<int, int>, HashByFirst>>();
420 } 420 }
421 421
422 TEST(ContainsValue, OrdinaryArrays) {
423 const char allowed_chars[] = {'a', 'b', 'c', 'd'};
424 EXPECT_TRUE(ContainsValue(allowed_chars, 'a'));
425 EXPECT_FALSE(ContainsValue(allowed_chars, 'z'));
426 EXPECT_FALSE(ContainsValue(allowed_chars, 0));
427
428 const char allowed_chars_including_nul[] = "abcd";
429 EXPECT_TRUE(ContainsValue(allowed_chars_including_nul, 0));
430 }
431
422 } // namespace 432 } // namespace
423 } // namespace base 433 } // namespace base
OLDNEW
« no previous file with comments | « base/stl_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698