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

gapi(test): ban and get rid of countNonZero() checks

This commit is contained in:
Alexander Alekhin
2020-02-23 17:49:50 +00:00
committed by Alexander Alekhin
parent 102ef39a27
commit f2d3edec80
22 changed files with 200 additions and 263 deletions
@@ -70,8 +70,8 @@ TEST(GExecutor, SmokeTest)
cv::boxFilter(ocv_tmp3, out_ocv[1], -1, cv::Size(3,3));
}
EXPECT_EQ(0, cv::countNonZero(out_gapi[0] != out_ocv[0]));
EXPECT_EQ(0, cv::countNonZero(out_gapi[1] != out_ocv[1]));
EXPECT_EQ(0, cvtest::norm(out_gapi[0], out_ocv[0], NORM_INF));
EXPECT_EQ(0, cvtest::norm(out_gapi[1], out_ocv[1], NORM_INF));
// FIXME: check that GIslandModel has more than 1 island (e.g. fusion
// with breakdown worked)
@@ -116,8 +116,8 @@ TEST(GComputationCompile, FluidReshapeResizeDownScale)
cv::resize(in_mat1, cv_out_mat1, szOut);
cv::resize(in_mat2, cv_out_mat2, szOut);
EXPECT_EQ(0, cv::countNonZero(out_mat1 != cv_out_mat1));
EXPECT_EQ(0, cv::countNonZero(out_mat2 != cv_out_mat2));
EXPECT_EQ(0, cvtest::norm(out_mat1, cv_out_mat1, NORM_INF));
EXPECT_EQ(0, cvtest::norm(out_mat2, cv_out_mat2, NORM_INF));
}
TEST(GComputationCompile, FluidReshapeSwitchToUpscaleFromDownscale)
@@ -151,9 +151,9 @@ TEST(GComputationCompile, FluidReshapeSwitchToUpscaleFromDownscale)
cv::resize(in_mat2, cv_out_mat2, szOut);
cv::resize(in_mat3, cv_out_mat3, szOut);
EXPECT_EQ(0, cv::countNonZero(out_mat1 != cv_out_mat1));
EXPECT_EQ(0, cv::countNonZero(out_mat2 != cv_out_mat2));
EXPECT_EQ(0, cv::countNonZero(out_mat3 != cv_out_mat3));
EXPECT_EQ(0, cvtest::norm(out_mat1, cv_out_mat1, NORM_INF));
EXPECT_EQ(0, cvtest::norm(out_mat2, cv_out_mat2, NORM_INF));
EXPECT_EQ(0, cvtest::norm(out_mat3, cv_out_mat3, NORM_INF));
}
TEST(GComputationCompile, ReshapeBlur)
@@ -181,8 +181,8 @@ TEST(GComputationCompile, ReshapeBlur)
cv::blur(in_mat1, cv_out_mat1, kernelSize);
cv::blur(in_mat2, cv_out_mat2, kernelSize);
EXPECT_EQ(0, cv::countNonZero(out_mat1 != cv_out_mat1));
EXPECT_EQ(0, cv::countNonZero(out_mat2 != cv_out_mat2));
EXPECT_EQ(0, cvtest::norm(out_mat1, cv_out_mat1, NORM_INF));
EXPECT_EQ(0, cvtest::norm(out_mat2, cv_out_mat2, NORM_INF));
}
TEST(GComputationCompile, ReshapeRois)
@@ -225,7 +225,7 @@ TEST(GComputationCompile, ReshapeRois)
cv::blur(in_mat, blur_mat, kernelSize);
cv::resize(blur_mat, cv_out_mat, szOut);
EXPECT_EQ(0, cv::countNonZero(out_mat(roi) != cv_out_mat(roi)));
EXPECT_EQ(0, cvtest::norm(out_mat(roi), cv_out_mat(roi), NORM_INF));
}
}