From 700c1665c911e006222c7f9e7643c9b90be2a9d2 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Thu, 29 Mar 2012 03:05:41 +0000 Subject: [PATCH] Fixed 2 spontaneously failing tests --- modules/core/test/test_arithm.cpp | 6 +++--- modules/imgproc/test/test_boundingrect.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/core/test/test_arithm.cpp b/modules/core/test/test_arithm.cpp index 1c6b76c..2d55796 100644 --- a/modules/core/test/test_arithm.cpp +++ b/modules/core/test/test_arithm.cpp @@ -1448,7 +1448,7 @@ protected: compare(mask, 0, mask1, CMP_EQ); a1.setTo(0, mask1); b1.setTo(0, mask1); - + if( op == 0 ) { add(a, b, c, mask); @@ -1476,12 +1476,12 @@ protected: } Mat d1; d.convertTo(d1, depth); - CV_Assert( norm(c, d1, CV_C) == 0 ); + CV_Assert( norm(c, d1, CV_C) <= DBL_EPSILON ); } } catch(...) { - ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH); + ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH); } } }; diff --git a/modules/imgproc/test/test_boundingrect.cpp b/modules/imgproc/test/test_boundingrect.cpp index e8d760c..ffd52ba 100644 --- a/modules/imgproc/test/test_boundingrect.cpp +++ b/modules/imgproc/test/test_boundingrect.cpp @@ -89,7 +89,7 @@ template cv::Rect CV_BoundingRectTest::get_bounding_rect(const vect max_h = std::max(src.at(i).y, max_h); } - return Rect((int)min_w, (int)min_h, (int)(floor(1.0*(max_w-min_w)) + 1), (int)(floor(1.0*(max_h-min_h)) + 1)); + return Rect((int)min_w, (int)min_h, (int)max_w-(int)min_w + 1, (int)max_h-(int)min_h + 1); } template bool CV_BoundingRectTest::checking_function_work(vector >& src, int type) -- 2.7.4