1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

ts: refactor OpenCV tests

- removed tr1 usage (dropped in C++17)
- moved includes of vector/map/iostream/limits into ts.hpp
- require opencv_test + anonymous namespace (added compile check)
- fixed norm() usage (must be from cvtest::norm for checks) and other conflict functions
- added missing license headers
This commit is contained in:
Alexander Alekhin
2017-11-05 13:48:40 +00:00
parent f1e50ecab3
commit 4a297a2443
435 changed files with 2009 additions and 2378 deletions
+6 -15
View File
@@ -4,25 +4,16 @@
#ifdef HAVE_OPENCL
namespace cvtest
{
namespace ocl
{
using std::tr1::tuple;
using std::tr1::get;
using std::tr1::make_tuple;
using std::make_pair;
using namespace perf;
using namespace testing;
using namespace cv;
using namespace cv::dnn;
namespace opencv_test { namespace ocl {
using namespace ::perf;
namespace {
enum {STRIDE_OFF = 1, STRIDE_ON = 2};
CV_ENUM(StrideSize, STRIDE_OFF, STRIDE_ON);
enum {GROUP_OFF = 1, GROUP_2 = 2};
CV_ENUM(GroupSize, GROUP_OFF, GROUP_2);
} // namespace
//Squared Size
#define SSZ(n) cv::Size(n, n)
@@ -80,11 +71,11 @@ OCL_PERF_TEST_P( ConvolutionPerfTest, perf, Combine(
Ptr<Layer> layer = cv::dnn::LayerFactory::createLayerInstance("Convolution", lp);
std::vector<MatShape> inputShapes(1, shape(inpBlob)), outShapes, internals;
layer->getMemoryShapes(inputShapes, 0, outShapes, internals);
for (int i = 0; i < outShapes.size(); i++)
for (size_t i = 0; i < outShapes.size(); i++)
{
outBlobs.push_back(Mat(outShapes[i], CV_32F));
}
for (int i = 0; i < internals.size(); i++)
for (size_t i = 0; i < internals.size(); i++)
{
internalBlobs.push_back(Mat());
if (total(internals[i]))