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

Side by Side Diff: base/containers/small_map_unittest.cc

Issue 11419224: Add missing (and remove superfluous) 'explicit' from constructors. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + remove non-straightforward changes Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « base/callback_unittest.cc ('k') | base/debug/stack_trace_posix.cc » ('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 "base/containers/small_map.h" 5 #include "base/containers/small_map.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <functional> 10 #include <functional>
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 EXPECT_EQ(0u, hm.size()); 417 EXPECT_EQ(0u, hm.size());
418 SmallMap<std::map<int, int> > m; 418 SmallMap<std::map<int, int> > m;
419 EXPECT_EQ(0u, m.size()); 419 EXPECT_EQ(0u, m.size());
420 } 420 }
421 421
422 namespace { 422 namespace {
423 423
424 class hash_map_add_item : public hash_map<int, int> { 424 class hash_map_add_item : public hash_map<int, int> {
425 public: 425 public:
426 hash_map_add_item() : hash_map<int, int>() {} 426 hash_map_add_item() : hash_map<int, int>() {}
427 hash_map_add_item(const std::pair<int, int>& item) : hash_map<int, int>() { 427 explicit hash_map_add_item(const std::pair<int, int>& item)
428 : hash_map<int, int>() {
428 insert(item); 429 insert(item);
429 } 430 }
430 }; 431 };
431 432
432 void InitMap(ManualConstructor<hash_map_add_item>* map_ctor) { 433 void InitMap(ManualConstructor<hash_map_add_item>* map_ctor) {
433 map_ctor->Init(std::make_pair(0, 0)); 434 map_ctor->Init(std::make_pair(0, 0));
434 } 435 }
435 436
436 class hash_map_add_item_initializer { 437 class hash_map_add_item_initializer {
437 public: 438 public:
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 EXPECT_EQ(4u, m.size()); 483 EXPECT_EQ(4u, m.size());
483 EXPECT_EQ(0u, m.count(-1)); 484 EXPECT_EQ(0u, m.count(-1));
484 485
485 m[5] = 5; 486 m[5] = 5;
486 EXPECT_EQ(6u, m.size()); 487 EXPECT_EQ(6u, m.size());
487 // Our functor adds an extra item when we convert to a map. 488 // Our functor adds an extra item when we convert to a map.
488 EXPECT_EQ(1u, m.count(-1)); 489 EXPECT_EQ(1u, m.count(-1));
489 } 490 }
490 491
491 } // namespace base 492 } // namespace base
OLDNEW
« no previous file with comments | « base/callback_unittest.cc ('k') | base/debug/stack_trace_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698