From 4b2363de5cbc2e90af51d66bdbbb436ff1327498 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 24 Jan 2020 14:20:08 +0300 Subject: [PATCH] gapi(test): update test tolerance for DIV operation on ARM --- modules/gapi/test/common/gapi_core_tests_inl.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/gapi/test/common/gapi_core_tests_inl.hpp b/modules/gapi/test/common/gapi_core_tests_inl.hpp index 64d842ddfa..4a73d758ac 100644 --- a/modules/gapi/test/common/gapi_core_tests_inl.hpp +++ b/modules/gapi/test/common/gapi_core_tests_inl.hpp @@ -120,9 +120,13 @@ TEST_P(MathOpTest, MatricesAccuracyTest) CV_MAT_DEPTH(out_mat_ocv.type()) != CV_64F) { // integral: allow 1% of differences, and no diffs by >1 unit - EXPECT_LE(countNonZeroPixels(cv::abs(out_mat_gapi - out_mat_ocv) > 0), - 0.01*out_mat_ocv.total()); - EXPECT_LE(countNonZeroPixels(cv::abs(out_mat_gapi - out_mat_ocv) > 1), 0); + EXPECT_LE(cvtest::norm(out_mat_gapi, out_mat_ocv, NORM_INF), 1); // check: abs(a[i] - b[i]) <= 1 + float tolerance = 0.01f; +#if defined(__arm__) || defined(__aarch64__) + if (opType == DIV) + tolerance = 0.05f; +#endif + EXPECT_LE(cvtest::norm(out_mat_gapi, out_mat_ocv, NORM_L1), tolerance*out_mat_ocv.total()); } else {