diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-03 17:04:28 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-03 17:04:28 +0000 |
commit | 35dabb168a48a717d9ba0ecabff33295abf9f073 (patch) | |
tree | 36a182c2ff5868c6c0d07c9c8b73ce0a73b72b5e /base/id_map_unittest.cc | |
parent | 8be50f06b56d45e148a0f84118ba0f8c2aa61db0 (diff) | |
download | chromium_src-35dabb168a48a717d9ba0ecabff33295abf9f073.zip chromium_src-35dabb168a48a717d9ba0ecabff33295abf9f073.tar.gz chromium_src-35dabb168a48a717d9ba0ecabff33295abf9f073.tar.bz2 |
base: Use TEST() macro when possible.
There is no need to inherit from testing::Test and then have to use TEST_F(),
if you aren't overridding SetUp() or TearDow(). So if you don't need to customize
it, you can use TEST() macro directly and it does that for us automagically.
Fix all the cases found with the following command line:
$ git grep -n1 "public testing::Test" base/ | grep "};"
TEST=base_unittests
R=willchan@chromium.org
Review URL: https://codereview.chromium.org/11308261
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170747 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/id_map_unittest.cc')
-rw-r--r-- | base/id_map_unittest.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/base/id_map_unittest.cc b/base/id_map_unittest.cc index 80c4c66..76d7c3e 100644 --- a/base/id_map_unittest.cc +++ b/base/id_map_unittest.cc @@ -8,9 +8,6 @@ namespace { -class IDMapTest : public testing::Test { -}; - class TestObject { }; @@ -18,11 +15,12 @@ class DestructorCounter { public: explicit DestructorCounter(int* counter) : counter_(counter) {} ~DestructorCounter() { ++(*counter_); } + private: int* counter_; }; -TEST_F(IDMapTest, Basic) { +TEST(IDMapTest, Basic) { IDMap<TestObject> map; EXPECT_TRUE(map.IsEmpty()); EXPECT_EQ(0U, map.size()); @@ -58,7 +56,7 @@ TEST_F(IDMapTest, Basic) { EXPECT_EQ(0, map.iteration_depth()); } -TEST_F(IDMapTest, IteratorRemainsValidWhenRemovingCurrentElement) { +TEST(IDMapTest, IteratorRemainsValidWhenRemovingCurrentElement) { IDMap<TestObject> map; TestObject obj1; @@ -91,7 +89,7 @@ TEST_F(IDMapTest, IteratorRemainsValidWhenRemovingCurrentElement) { EXPECT_EQ(0, map.iteration_depth()); } -TEST_F(IDMapTest, IteratorRemainsValidWhenRemovingOtherElements) { +TEST(IDMapTest, IteratorRemainsValidWhenRemovingOtherElements) { IDMap<TestObject> map; const int kCount = 5; @@ -133,7 +131,7 @@ TEST_F(IDMapTest, IteratorRemainsValidWhenRemovingOtherElements) { EXPECT_EQ(0, map.iteration_depth()); } -TEST_F(IDMapTest, CopyIterator) { +TEST(IDMapTest, CopyIterator) { IDMap<TestObject> map; TestObject obj1; @@ -161,7 +159,7 @@ TEST_F(IDMapTest, CopyIterator) { EXPECT_EQ(0, map.iteration_depth()); } -TEST_F(IDMapTest, AssignIterator) { +TEST(IDMapTest, AssignIterator) { IDMap<TestObject> map; TestObject obj1; @@ -191,7 +189,7 @@ TEST_F(IDMapTest, AssignIterator) { EXPECT_EQ(0, map.iteration_depth()); } -TEST_F(IDMapTest, IteratorRemainsValidWhenClearing) { +TEST(IDMapTest, IteratorRemainsValidWhenClearing) { IDMap<TestObject> map; const int kCount = 5; @@ -227,7 +225,7 @@ TEST_F(IDMapTest, IteratorRemainsValidWhenClearing) { EXPECT_EQ(0U, map.size()); } -TEST_F(IDMapTest, OwningPointersDeletesThemOnRemove) { +TEST(IDMapTest, OwningPointersDeletesThemOnRemove) { const int kCount = 3; int external_del_count = 0; @@ -265,7 +263,7 @@ TEST_F(IDMapTest, OwningPointersDeletesThemOnRemove) { EXPECT_EQ(owned_del_count, kCount); } -TEST_F(IDMapTest, OwningPointersDeletesThemOnClear) { +TEST(IDMapTest, OwningPointersDeletesThemOnClear) { const int kCount = 3; int external_del_count = 0; @@ -302,7 +300,7 @@ TEST_F(IDMapTest, OwningPointersDeletesThemOnClear) { EXPECT_EQ(owned_del_count, kCount); } -TEST_F(IDMapTest, OwningPointersDeletesThemOnDestruct) { +TEST(IDMapTest, OwningPointersDeletesThemOnDestruct) { const int kCount = 3; int external_del_count = 0; |