@@ -1205,10 +1205,10 @@ class FooTest : public testing::Test {
12051205 }
12061206
12071207 // You can define per-test set-up logic as usual.
1208- virtual void SetUp() { ... }
1208+ void SetUp() override { ... }
12091209
12101210 // You can define per-test tear-down logic as usual.
1211- virtual void TearDown() { ... }
1211+ void TearDown() override { ... }
12121212
12131213 // Some expensive resource shared by all tests.
12141214 static T* shared_resource_ ;
@@ -1239,7 +1239,7 @@ First, you subclass the `::testing::Environment` class to define a test
12391239environment, which knows how to set-up and tear-down:
12401240
12411241```c++
1242- class Environment : public testing::Environment {
1242+ class Environment : public :: testing::Environment {
12431243 public:
12441244 ~Environment() override {}
12451245
@@ -1974,13 +1974,13 @@ Here's an example:
19741974```c++
19751975 class MinimalistPrinter : public testing::EmptyTestEventListener {
19761976 // Called before a test starts.
1977- virtual void OnTestStart(const testing::TestInfo& test_info) {
1977+ void OnTestStart(const testing::TestInfo& test_info) override {
19781978 printf("*** Test %s.%s starting.\n",
19791979 test_info.test_suite_name(), test_info.name());
19801980 }
19811981
19821982 // Called after a failed assertion or a SUCCESS().
1983- virtual void OnTestPartResult(const testing::TestPartResult& test_part_result) {
1983+ void OnTestPartResult(const testing::TestPartResult& test_part_result) override {
19841984 printf("%s in %s:%d\n%s\n",
19851985 test_part_result.failed() ? "*** Failure" : "Success",
19861986 test_part_result.file_name(),
@@ -1989,7 +1989,7 @@ Here's an example:
19891989 }
19901990
19911991 // Called after a test ends.
1992- virtual void OnTestEnd(const testing::TestInfo& test_info) {
1992+ void OnTestEnd(const testing::TestInfo& test_info) override {
19931993 printf("*** Test %s.%s ending.\n",
19941994 test_info.test_suite_name(), test_info.name());
19951995 }
0 commit comments