diff --git a/modules/core/test/test_lpsolver.cpp b/modules/core/test/test_lpsolver.cpp index 4dd620a1f7..6b4d99b386 100644 --- a/modules/core/test/test_lpsolver.cpp +++ b/modules/core/test/test_lpsolver.cpp @@ -52,7 +52,7 @@ TEST(Core_LPSolver, regression_basic){ cv::solveLP(A,B,z); std::cout<<"here z goes\n"<(3,1)<<8,4,0); - ASSERT_EQ(cv::countNonZero(z!=etalon_z),0); + ASSERT_LT(cvtest::norm(z, etalon_z, cv::NORM_L1), 1e-12); #endif #if 1 @@ -63,7 +63,7 @@ TEST(Core_LPSolver, regression_basic){ cv::solveLP(A,B,z); std::cout<<"here z goes\n"<(2,1)<<20,0); - ASSERT_EQ(cv::countNonZero(z!=etalon_z),0); + ASSERT_LT(cvtest::norm(z, etalon_z, cv::NORM_L1), 1e-12); #endif #if 1 @@ -74,7 +74,7 @@ TEST(Core_LPSolver, regression_basic){ cv::solveLP(A,B,z); std::cout<<"here z goes\n"<(2,1)<<1,0); - ASSERT_EQ(cv::countNonZero(z!=etalon_z),0); + ASSERT_LT(cvtest::norm(z, etalon_z, cv::NORM_L1), 1e-12); #endif } @@ -89,7 +89,7 @@ TEST(Core_LPSolver, regression_init_unfeasible){ cv::solveLP(A,B,z); std::cout<<"here z goes\n"<(3,1)<<1250,1000,0); - ASSERT_EQ(cv::countNonZero(z!=etalon_z),0); + ASSERT_LT(cvtest::norm(z, etalon_z, cv::NORM_L1), 1e-12); #endif } @@ -119,7 +119,7 @@ TEST(Core_LPSolver, regression_multiple_solutions){ printf("scalar %g\n",z.dot(A)); std::cout<<"here z goes\n"<