OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Tests for chromium style checks for virtual/override/final specifiers on | 5 // Tests for chromium style checks for virtual/override/final specifiers on |
6 // virtual methods. | 6 // virtual methods. |
7 | 7 |
| 8 // Note: This is not actual windows.h but the stub file in system/windows.h |
8 #include <windows.h> | 9 #include <windows.h> |
9 | 10 |
10 // Purposely use macros to test that the FixIt hints don't try to remove the | 11 // Purposely use macros to test that the FixIt hints don't try to remove the |
11 // macro body. | 12 // macro body. |
12 #define OVERRIDE override | 13 #define OVERRIDE override |
13 #define FINAL final | 14 #define FINAL final |
14 | 15 |
15 // Base class can only use virtual. | 16 // Base class can only use virtual. |
16 class Base { | 17 class Base { |
17 public: | 18 public: |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 public: | 110 public: |
110 virtual ~MyTest(); | 111 virtual ~MyTest(); |
111 virtual void SetUp() override; | 112 virtual void SetUp() override; |
112 }; | 113 }; |
113 | 114 |
114 class MyNotTest : public testing::NotTest { | 115 class MyNotTest : public testing::NotTest { |
115 public: | 116 public: |
116 virtual ~MyNotTest(); | 117 virtual ~MyNotTest(); |
117 virtual void SetUp() override; | 118 virtual void SetUp() override; |
118 }; | 119 }; |
| 120 |
| 121 class MacroBase { |
| 122 public: |
| 123 virtual void AddRef() = 0; |
| 124 virtual void Virtual() {} |
| 125 }; |
| 126 |
| 127 class Sub : public MacroBase { |
| 128 // Shouldn't warn. |
| 129 END_COM_MAP() |
| 130 SYSTEM_REDUNDANT1; |
| 131 SYSTEM_REDUNDANT2; |
| 132 }; |
OLD | NEW |