test for failure

This commit is contained in:
Konstantin Matskevich 2014-01-23 17:54:53 +04:00
parent 13875b5fbc
commit aa23a842a1

View File

@ -248,3 +248,28 @@ TEST(UMat, Sync)
EXPECT_EQ(0, cv::norm(um.getMat(ACCESS_READ), cv::Mat(um.size(), um.type(), 19), NORM_INF));
}
TEST(UMat, setOpenCL)
{
Mat m = (Mat_<uchar>(3,3)<<0,1,2,3,4,5,6,7,8);
ocl::setUseOpenCL(true);
UMat um1;
m.copyTo(um1);
ocl::setUseOpenCL(false);
UMat um2;
m.copyTo(um2);
ocl::setUseOpenCL(true);
countNonZero(um1);
countNonZero(um2);
um1.copyTo(um2);
um2.copyTo(um1);
ocl::setUseOpenCL(false);
countNonZero(um1);
countNonZero(um2);
um1.copyTo(um2);
um2.copyTo(um1);
}