cleaned-up UMat tests

This commit is contained in:
Ilya Lavrenov
2014-02-15 15:51:52 +04:00
parent 3542da7167
commit 4f36bc29d9
3 changed files with 40 additions and 156 deletions

View File

@@ -71,12 +71,19 @@ struct GetMatForRead<Mat>
{
static const Mat get(const Mat& m) { return m; }
};
template <>
struct GetMatForRead<UMat>
{
static const Mat get(const UMat& m) { return m.getMat(ACCESS_READ); }
};
template <>
struct GetMatForRead<MatExpr>
{
static const Mat get(const MatExpr& m) { return m; }
};
} // namespace traits
template <typename T>
@@ -91,14 +98,14 @@ extern int test_loop_times;
#define EXPECT_MAT_NORM(mat, eps) \
{ \
EXPECT_LE(checkNorm(mat), eps) \
EXPECT_LE(TestUtils::checkNorm(mat), eps) \
}
#define EXPECT_MAT_NEAR(mat1, mat2, eps) \
{ \
ASSERT_EQ(mat1.type(), mat2.type()); \
ASSERT_EQ(mat1.size(), mat2.size()); \
EXPECT_LE(checkNorm(mat1, mat2), eps) \
EXPECT_LE(TestUtils::checkNorm(mat1, mat2), eps) \
<< "Size: " << mat1.size() << std::endl; \
}
@@ -106,7 +113,7 @@ extern int test_loop_times;
{ \
ASSERT_EQ(mat1.type(), mat2.type()); \
ASSERT_EQ(mat1.size(), mat2.size()); \
EXPECT_LE(checkNormRelative(mat1, mat2), eps) \
EXPECT_LE(TestUtils::checkNormRelative(mat1, mat2), eps) \
<< "Size: " << mat1.size() << std::endl; \
}