From a8169f08fc4428b203b3bccef468fc027006c627 Mon Sep 17 00:00:00 2001 From: Alexander Karsakov Date: Thu, 9 Oct 2014 13:32:56 +0400 Subject: [PATCH] Used checking norm of results for LPSolver accuracy tests --- modules/core/test/test_lpsolver.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/core/test/test_lpsolver.cpp b/modules/core/test/test_lpsolver.cpp index 4dd620a..6b4d99b 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"<