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

Side by Side Diff: components/sync/base/enum_set_unittest.cc

Issue 2689773002: [Sync] Replace typedef with using. (Closed)
Patch Set: [Sync] Replace typedef with using. Created 3 years, 10 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 | « components/sync/base/enum_set.h ('k') | components/sync/base/extensions_activity.h » ('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 "components/sync/base/enum_set.h" 5 #include "components/sync/base/enum_set.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace syncer { 11 namespace syncer {
12 namespace { 12 namespace {
13 13
14 enum TestEnum { 14 enum TestEnum {
15 TEST_0, 15 TEST_0,
16 TEST_MIN = TEST_0, 16 TEST_MIN = TEST_0,
17 TEST_1, 17 TEST_1,
18 TEST_2, 18 TEST_2,
19 TEST_3, 19 TEST_3,
20 TEST_4, 20 TEST_4,
21 TEST_MAX = TEST_4, 21 TEST_MAX = TEST_4,
22 TEST_5 22 TEST_5
23 }; 23 };
24 24
25 typedef EnumSet<TestEnum, TEST_MIN, TEST_MAX> TestEnumSet; 25 using TestEnumSet = EnumSet<TestEnum, TEST_MIN, TEST_MAX>;
26 26
27 class EnumSetTest : public ::testing::Test {}; 27 class EnumSetTest : public ::testing::Test {};
28 28
29 TEST_F(EnumSetTest, ClassConstants) { 29 TEST_F(EnumSetTest, ClassConstants) {
30 TestEnumSet enums; 30 TestEnumSet enums;
31 EXPECT_EQ(TEST_MIN, TestEnumSet::kMinValue); 31 EXPECT_EQ(TEST_MIN, TestEnumSet::kMinValue);
32 EXPECT_EQ(TEST_MAX, TestEnumSet::kMaxValue); 32 EXPECT_EQ(TEST_MAX, TestEnumSet::kMaxValue);
33 EXPECT_EQ(static_cast<size_t>(5), TestEnumSet::kValueCount); 33 EXPECT_EQ(static_cast<size_t>(5), TestEnumSet::kValueCount);
34 } 34 }
35 35
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 TEST_F(EnumSetTest, Difference) { 187 TEST_F(EnumSetTest, Difference) {
188 const TestEnumSet enums1(TEST_3, TEST_4); 188 const TestEnumSet enums1(TEST_3, TEST_4);
189 const TestEnumSet enums2(TEST_2, TEST_3); 189 const TestEnumSet enums2(TEST_2, TEST_3);
190 const TestEnumSet enums3 = Difference(enums1, enums2); 190 const TestEnumSet enums3 = Difference(enums1, enums2);
191 191
192 EXPECT_EQ(TestEnumSet(TEST_4), enums3); 192 EXPECT_EQ(TestEnumSet(TEST_4), enums3);
193 } 193 }
194 194
195 } // namespace 195 } // namespace
196 } // namespace syncer 196 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/base/enum_set.h ('k') | components/sync/base/extensions_activity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698