OLD | NEW |
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 Loading... |
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 |
OLD | NEW |