• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 namespace blink {
6 
7 enum EnumInNamespace {
8   // These should be renamed to kConstantCase.
9   NamedWrong,
10   namedWrong2,
11   // This shouldn't exist but if it does renaming them will help us find them.
12   kNamedWrong3,
13 };
14 
15 class T {
16  public:
17   enum EnumInClass {
18     // These should be renamed to kConstantCase.
19     ClassNamedWrong,
20     classNamedWrong22,
21     // This shouldn't exist but if it does renaming them will help us find them.
22     kClassNamed33Wrong,
23   };
24 
25   enum class EnumClassInClass {
26     // These should be renamed to kConstantCase.
27     EnumClassNamedWrong,
28     enumClassNamedWrong22,
29     // This shouldn't exist but if it does renaming them will help us find them.
30     kEnumClassNamed33Wrong,
31   };
32 };
33 
34 // Is SHOUT_CAPS, so the naming shouldn't change.
35 enum AlreadyShouty {
36   ENABLE_DIRECTZ3000_SUPPORT_FOR_HL3E1,
37 };
38 
39 }  // namespace blink
40 
41 enum EnumOutsideNamespace {
42   // These should not be renamed.
43   OutNamedWrong,
44   outNamedWrong2,
45   kOutNamedWrong3,
46 };
47 
F()48 void F() {
49   // These should be renamed to kConstantCase.
50   blink::EnumInNamespace e1 = blink::NamedWrong;
51   blink::EnumInNamespace e2 = blink::namedWrong2;
52   blink::T::EnumInClass e3 = blink::T::ClassNamedWrong;
53   blink::T::EnumInClass e4 = blink::T::classNamedWrong22;
54   blink::T::EnumClassInClass e5 =
55       blink::T::EnumClassInClass::EnumClassNamedWrong;
56   blink::T::EnumClassInClass e6 =
57       blink::T::EnumClassInClass::enumClassNamedWrong22;
58   // These should not be renamed.
59   EnumOutsideNamespace e7 = OutNamedWrong;
60   EnumOutsideNamespace e8 = outNamedWrong2;
61 }
62 
G()63 int G() {
64   using blink::NamedWrong;
65   using blink::namedWrong2;
66   using blink::kNamedWrong3;
67   return NamedWrong | namedWrong2 | kNamedWrong3;
68 }
69