Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions modules/cudaarithm/test/test_gpumat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,49 @@ INSTANTIATE_TEST_CASE_P(CUDA, GpuMat_ConvertTo, testing::Combine(
ALL_DEPTH,
WHOLE_SUBMAT));

////////////////////////////////////////////////////////////////////////////////
// locateROI

PARAM_TEST_CASE(GpuMat_LocateROI, cv::cuda::DeviceInfo, cv::Size, MatDepth, UseRoi)
{
cv::cuda::DeviceInfo devInfo;
cv::Size size;
int depth;
bool useRoi;

virtual void SetUp()
{
devInfo = GET_PARAM(0);
size = GET_PARAM(1);
depth = GET_PARAM(2);
useRoi = GET_PARAM(3);

cv::cuda::setDevice(devInfo.deviceID());
}
};

CUDA_TEST_P(GpuMat_LocateROI, locateROI)
{
Point ofsGold;
Size wholeSizeGold;
GpuMat src = createMat(size, depth, wholeSizeGold, ofsGold, useRoi);

Point ofs;
Size wholeSize;
src.locateROI(wholeSize, ofs);
ASSERT_TRUE(ofs == ofsGold && wholeSize == wholeSizeGold);

GpuMat srcPtr(src.size(), src.type(), src.data, src.step);
src.locateROI(wholeSize, ofs);
ASSERT_TRUE(ofs == ofsGold && wholeSize == wholeSizeGold);
}

INSTANTIATE_TEST_CASE_P(CUDA, GpuMat_LocateROI, testing::Combine(
ALL_DEVICES,
DIFFERENT_SIZES,
ALL_DEPTH,
WHOLE_SUBMAT));

////////////////////////////////////////////////////////////////////////////////
// ensureSizeIsEnough

Expand Down