Skip to content

Commit bf99842

Browse files
authored
Merge pull request opencv#26146 from mshabunin:fix-test-overrides
ts: add some missing override markers
2 parents f143f45 + 9663245 commit bf99842

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

modules/ts/include/opencv2/ts/ocl_perf.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ using namespace perf;
6464
public: \
6565
OCL##_##fixture##_##name() { } \
6666
protected: \
67-
virtual void PerfTestBody(); \
67+
virtual void PerfTestBody() CV_OVERRIDE; \
6868
}; \
6969
TEST_F(OCL##_##fixture##_##name, name) { CV_TRACE_REGION("PERF_TEST: " #fixture "_" #name); declare.strategy(OCL_PERF_STRATEGY); RunPerfTestBody(); } \
7070
void OCL##_##fixture##_##name::PerfTestBody()
@@ -76,7 +76,7 @@ using namespace perf;
7676
public: \
7777
OCL##_##fixture##_##name() { } \
7878
protected: \
79-
virtual void PerfTestBody(); \
79+
virtual void PerfTestBody() CV_OVERRIDE; \
8080
}; \
8181
TEST_P(OCL##_##fixture##_##name, name) { CV_TRACE_REGION("PERF_TEST_P: " #fixture "_" #name); declare.strategy(OCL_PERF_STRATEGY); RunPerfTestBody(); } \
8282
INSTANTIATE_TEST_CASE_P(/*none*/, OCL##_##fixture##_##name, params); \

modules/ts/include/opencv2/ts/ts_ext.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct SkipThisTest : public ::testing::Test {
8585
};\
8686
class test_case_name##test_name##_factory : public ::testing::internal::TestFactoryBase { \
8787
public:\
88-
virtual ::testing::Test* CreateTest() { \
88+
virtual ::testing::Test* CreateTest() CV_OVERRIDE { \
8989
try { \
9090
return new GTEST_TEST_CLASS_NAME_(test_case_name, test_name); \
9191
} catch (const cvtest::details::SkipTestExceptionBase& e) { \
@@ -150,7 +150,7 @@ struct SkipThisTest : public ::testing::Test {
150150
};\
151151
class test_fixture##test_name##_factory : public ::testing::internal::TestFactoryBase { \
152152
public:\
153-
virtual ::testing::Test* CreateTest() { \
153+
virtual ::testing::Test* CreateTest() CV_OVERRIDE { \
154154
try { \
155155
return new GTEST_TEST_CLASS_NAME_(test_fixture, test_name); \
156156
} catch (const cvtest::details::SkipTestExceptionBase& e) { \

modules/ts/include/opencv2/ts/ts_gtest.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8458,7 +8458,7 @@ class TestFactoryBase {
84588458
template <class TestClass>
84598459
class TestFactoryImpl : public TestFactoryBase {
84608460
public:
8461-
virtual Test* CreateTest() { return new TestClass; }
8461+
virtual Test* CreateTest() override { return new TestClass; }
84628462
};
84638463

84648464
#if GTEST_OS_WINDOWS
@@ -11927,7 +11927,7 @@ class ParameterizedTestFactory : public internal::TestFactoryBase {
1192711927
typedef typename TestClass::ParamType ParamType;
1192811928
explicit ParameterizedTestFactory(ParamType parameter) :
1192911929
parameter_(parameter) {}
11930-
virtual Test* CreateTest() {
11930+
virtual Test* CreateTest() override {
1193111931
TestClass::SetParam(&parameter_);
1193211932
return new TestClass();
1193311933
}
@@ -11968,7 +11968,7 @@ class TestMetaFactory
1196811968

1196911969
TestMetaFactory() {}
1197011970

11971-
virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
11971+
virtual TestFactoryBase* CreateTestFactory(ParamType parameter) override {
1197211972
return new ParameterizedTestFactory<TestCase>(parameter);
1197311973
}
1197411974

@@ -12030,9 +12030,9 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
1203012030
: test_case_name_(name), code_location_(code_location) {}
1203112031

1203212032
// Test case base name for display purposes.
12033-
virtual const std::string& GetTestCaseName() const { return test_case_name_; }
12033+
virtual const std::string& GetTestCaseName() const override { return test_case_name_; }
1203412034
// Test case id to verify identity.
12035-
virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
12035+
virtual TypeId GetTestCaseTypeId() const override { return GetTypeId<TestCase>(); }
1203612036
// TEST_P macro uses AddTestPattern() to record information
1203712037
// about a single test in a LocalTestInfo structure.
1203812038
// test_case_name is the base name of the test case (without invocation
@@ -12061,7 +12061,7 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
1206112061
// This method should not be called more then once on any single
1206212062
// instance of a ParameterizedTestCaseInfoBase derived class.
1206312063
// UnitTest has a guard to prevent from calling this method more then once.
12064-
virtual void RegisterTests() {
12064+
virtual void RegisterTests() override {
1206512065
for (typename TestInfoContainer::iterator test_it = tests_.begin();
1206612066
test_it != tests_.end(); ++test_it) {
1206712067
linked_ptr<TestInfo> test_info = *test_it;

modules/ts/include/opencv2/ts/ts_perf.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ void PrintTo(const Size& sz, ::std::ostream* os);
585585
public:\
586586
fixture() {}\
587587
protected:\
588-
virtual void PerfTestBody();\
588+
virtual void PerfTestBody() CV_OVERRIDE;\
589589
};\
590590
TEST_F(fixture, testname){ CV__PERF_TEST_BODY_IMPL(#fixture "_" #testname); }\
591591
}\
@@ -626,7 +626,7 @@ void PrintTo(const Size& sz, ::std::ostream* os);
626626
public:\
627627
fixture##_##name() {}\
628628
protected:\
629-
virtual void PerfTestBody();\
629+
virtual void PerfTestBody() CV_OVERRIDE;\
630630
};\
631631
CV__TEST_P(fixture##_##name, name, PerfTestBodyDummy,, CV__PERF_TEST_BODY_IMPL){} \
632632
INSTANTIATE_TEST_CASE_P(/*none*/, fixture##_##name, params);\

0 commit comments

Comments
 (0)