mirror of
https://github.com/opencv/opencv.git
synced 2025-06-09 18:43:05 +08:00
Merge pull request #26146 from mshabunin:fix-test-overrides
ts: add some missing override markers
This commit is contained in:
commit
bf998429f6
@ -64,7 +64,7 @@ using namespace perf;
|
|||||||
public: \
|
public: \
|
||||||
OCL##_##fixture##_##name() { } \
|
OCL##_##fixture##_##name() { } \
|
||||||
protected: \
|
protected: \
|
||||||
virtual void PerfTestBody(); \
|
virtual void PerfTestBody() CV_OVERRIDE; \
|
||||||
}; \
|
}; \
|
||||||
TEST_F(OCL##_##fixture##_##name, name) { CV_TRACE_REGION("PERF_TEST: " #fixture "_" #name); declare.strategy(OCL_PERF_STRATEGY); RunPerfTestBody(); } \
|
TEST_F(OCL##_##fixture##_##name, name) { CV_TRACE_REGION("PERF_TEST: " #fixture "_" #name); declare.strategy(OCL_PERF_STRATEGY); RunPerfTestBody(); } \
|
||||||
void OCL##_##fixture##_##name::PerfTestBody()
|
void OCL##_##fixture##_##name::PerfTestBody()
|
||||||
@ -76,7 +76,7 @@ using namespace perf;
|
|||||||
public: \
|
public: \
|
||||||
OCL##_##fixture##_##name() { } \
|
OCL##_##fixture##_##name() { } \
|
||||||
protected: \
|
protected: \
|
||||||
virtual void PerfTestBody(); \
|
virtual void PerfTestBody() CV_OVERRIDE; \
|
||||||
}; \
|
}; \
|
||||||
TEST_P(OCL##_##fixture##_##name, name) { CV_TRACE_REGION("PERF_TEST_P: " #fixture "_" #name); declare.strategy(OCL_PERF_STRATEGY); RunPerfTestBody(); } \
|
TEST_P(OCL##_##fixture##_##name, name) { CV_TRACE_REGION("PERF_TEST_P: " #fixture "_" #name); declare.strategy(OCL_PERF_STRATEGY); RunPerfTestBody(); } \
|
||||||
INSTANTIATE_TEST_CASE_P(/*none*/, OCL##_##fixture##_##name, params); \
|
INSTANTIATE_TEST_CASE_P(/*none*/, OCL##_##fixture##_##name, params); \
|
||||||
|
@ -85,7 +85,7 @@ struct SkipThisTest : public ::testing::Test {
|
|||||||
};\
|
};\
|
||||||
class test_case_name##test_name##_factory : public ::testing::internal::TestFactoryBase { \
|
class test_case_name##test_name##_factory : public ::testing::internal::TestFactoryBase { \
|
||||||
public:\
|
public:\
|
||||||
virtual ::testing::Test* CreateTest() { \
|
virtual ::testing::Test* CreateTest() CV_OVERRIDE { \
|
||||||
try { \
|
try { \
|
||||||
return new GTEST_TEST_CLASS_NAME_(test_case_name, test_name); \
|
return new GTEST_TEST_CLASS_NAME_(test_case_name, test_name); \
|
||||||
} catch (const cvtest::details::SkipTestExceptionBase& e) { \
|
} catch (const cvtest::details::SkipTestExceptionBase& e) { \
|
||||||
@ -150,7 +150,7 @@ struct SkipThisTest : public ::testing::Test {
|
|||||||
};\
|
};\
|
||||||
class test_fixture##test_name##_factory : public ::testing::internal::TestFactoryBase { \
|
class test_fixture##test_name##_factory : public ::testing::internal::TestFactoryBase { \
|
||||||
public:\
|
public:\
|
||||||
virtual ::testing::Test* CreateTest() { \
|
virtual ::testing::Test* CreateTest() CV_OVERRIDE { \
|
||||||
try { \
|
try { \
|
||||||
return new GTEST_TEST_CLASS_NAME_(test_fixture, test_name); \
|
return new GTEST_TEST_CLASS_NAME_(test_fixture, test_name); \
|
||||||
} catch (const cvtest::details::SkipTestExceptionBase& e) { \
|
} catch (const cvtest::details::SkipTestExceptionBase& e) { \
|
||||||
|
@ -8458,7 +8458,7 @@ class TestFactoryBase {
|
|||||||
template <class TestClass>
|
template <class TestClass>
|
||||||
class TestFactoryImpl : public TestFactoryBase {
|
class TestFactoryImpl : public TestFactoryBase {
|
||||||
public:
|
public:
|
||||||
virtual Test* CreateTest() { return new TestClass; }
|
virtual Test* CreateTest() override { return new TestClass; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#if GTEST_OS_WINDOWS
|
#if GTEST_OS_WINDOWS
|
||||||
@ -11927,7 +11927,7 @@ class ParameterizedTestFactory : public internal::TestFactoryBase {
|
|||||||
typedef typename TestClass::ParamType ParamType;
|
typedef typename TestClass::ParamType ParamType;
|
||||||
explicit ParameterizedTestFactory(ParamType parameter) :
|
explicit ParameterizedTestFactory(ParamType parameter) :
|
||||||
parameter_(parameter) {}
|
parameter_(parameter) {}
|
||||||
virtual Test* CreateTest() {
|
virtual Test* CreateTest() override {
|
||||||
TestClass::SetParam(¶meter_);
|
TestClass::SetParam(¶meter_);
|
||||||
return new TestClass();
|
return new TestClass();
|
||||||
}
|
}
|
||||||
@ -11968,7 +11968,7 @@ class TestMetaFactory
|
|||||||
|
|
||||||
TestMetaFactory() {}
|
TestMetaFactory() {}
|
||||||
|
|
||||||
virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
|
virtual TestFactoryBase* CreateTestFactory(ParamType parameter) override {
|
||||||
return new ParameterizedTestFactory<TestCase>(parameter);
|
return new ParameterizedTestFactory<TestCase>(parameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12030,9 +12030,9 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
|
|||||||
: test_case_name_(name), code_location_(code_location) {}
|
: test_case_name_(name), code_location_(code_location) {}
|
||||||
|
|
||||||
// Test case base name for display purposes.
|
// Test case base name for display purposes.
|
||||||
virtual const std::string& GetTestCaseName() const { return test_case_name_; }
|
virtual const std::string& GetTestCaseName() const override { return test_case_name_; }
|
||||||
// Test case id to verify identity.
|
// Test case id to verify identity.
|
||||||
virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
|
virtual TypeId GetTestCaseTypeId() const override { return GetTypeId<TestCase>(); }
|
||||||
// TEST_P macro uses AddTestPattern() to record information
|
// TEST_P macro uses AddTestPattern() to record information
|
||||||
// about a single test in a LocalTestInfo structure.
|
// about a single test in a LocalTestInfo structure.
|
||||||
// test_case_name is the base name of the test case (without invocation
|
// test_case_name is the base name of the test case (without invocation
|
||||||
@ -12061,7 +12061,7 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
|
|||||||
// This method should not be called more then once on any single
|
// This method should not be called more then once on any single
|
||||||
// instance of a ParameterizedTestCaseInfoBase derived class.
|
// instance of a ParameterizedTestCaseInfoBase derived class.
|
||||||
// UnitTest has a guard to prevent from calling this method more then once.
|
// UnitTest has a guard to prevent from calling this method more then once.
|
||||||
virtual void RegisterTests() {
|
virtual void RegisterTests() override {
|
||||||
for (typename TestInfoContainer::iterator test_it = tests_.begin();
|
for (typename TestInfoContainer::iterator test_it = tests_.begin();
|
||||||
test_it != tests_.end(); ++test_it) {
|
test_it != tests_.end(); ++test_it) {
|
||||||
linked_ptr<TestInfo> test_info = *test_it;
|
linked_ptr<TestInfo> test_info = *test_it;
|
||||||
|
@ -585,7 +585,7 @@ void PrintTo(const Size& sz, ::std::ostream* os);
|
|||||||
public:\
|
public:\
|
||||||
fixture() {}\
|
fixture() {}\
|
||||||
protected:\
|
protected:\
|
||||||
virtual void PerfTestBody();\
|
virtual void PerfTestBody() CV_OVERRIDE;\
|
||||||
};\
|
};\
|
||||||
TEST_F(fixture, testname){ CV__PERF_TEST_BODY_IMPL(#fixture "_" #testname); }\
|
TEST_F(fixture, testname){ CV__PERF_TEST_BODY_IMPL(#fixture "_" #testname); }\
|
||||||
}\
|
}\
|
||||||
@ -626,7 +626,7 @@ void PrintTo(const Size& sz, ::std::ostream* os);
|
|||||||
public:\
|
public:\
|
||||||
fixture##_##name() {}\
|
fixture##_##name() {}\
|
||||||
protected:\
|
protected:\
|
||||||
virtual void PerfTestBody();\
|
virtual void PerfTestBody() CV_OVERRIDE;\
|
||||||
};\
|
};\
|
||||||
CV__TEST_P(fixture##_##name, name, PerfTestBodyDummy,, CV__PERF_TEST_BODY_IMPL){} \
|
CV__TEST_P(fixture##_##name, name, PerfTestBodyDummy,, CV__PERF_TEST_BODY_IMPL){} \
|
||||||
INSTANTIATE_TEST_CASE_P(/*none*/, fixture##_##name, params);\
|
INSTANTIATE_TEST_CASE_P(/*none*/, fixture##_##name, params);\
|
||||||
|
Loading…
Reference in New Issue
Block a user