Commit da6dc677 authored by Alexander Alekhin's avatar Alexander Alekhin Committed by Alexander Alekhin

features2d: add verbose messages into tests

To investigate sporadic failures of Features2d_FLANN_Auto.regression test.
parent 24bed38c
...@@ -112,11 +112,7 @@ int NearestNeighborTest::checkFind( const Mat& data ) ...@@ -112,11 +112,7 @@ int NearestNeighborTest::checkFind( const Mat& data )
} }
double correctPerc = correctMatches / (double)pointsCount; double correctPerc = correctMatches / (double)pointsCount;
if (correctPerc < .75) EXPECT_GE(correctPerc, .75) << "correctMatches=" << correctMatches << " pointsCount=" << pointsCount;
{
ts->printf( cvtest::TS::LOG, "correct_perc = %d\n", correctPerc );
code = cvtest::TS::FAIL_BAD_ACCURACY;
}
} }
return code; return code;
...@@ -152,6 +148,7 @@ void NearestNeighborTest::run( int /*start_from*/ ) { ...@@ -152,6 +148,7 @@ void NearestNeighborTest::run( int /*start_from*/ ) {
releaseModel(); releaseModel();
if (::testing::Test::HasFailure()) code = cvtest::TS::FAIL_BAD_ACCURACY;
ts->set_failed_test_info( code ); ts->set_failed_test_info( code );
} }
...@@ -201,10 +198,9 @@ int CV_FlannTest::knnSearch( Mat& points, Mat& neighbors ) ...@@ -201,10 +198,9 @@ int CV_FlannTest::knnSearch( Mat& points, Mat& neighbors )
} }
// compare results // compare results
if( cvtest::norm( neighbors, neighbors1, NORM_L1 ) != 0 ) EXPECT_LE(cvtest::norm(neighbors, neighbors1, NORM_L1), 0);
return cvtest::TS::FAIL_BAD_ACCURACY;
return cvtest::TS::OK; return ::testing::Test::HasFailure() ? cvtest::TS::FAIL_BAD_ACCURACY : cvtest::TS::OK;
} }
int CV_FlannTest::radiusSearch( Mat& points, Mat& neighbors ) int CV_FlannTest::radiusSearch( Mat& points, Mat& neighbors )
...@@ -232,11 +228,11 @@ int CV_FlannTest::radiusSearch( Mat& points, Mat& neighbors ) ...@@ -232,11 +228,11 @@ int CV_FlannTest::radiusSearch( Mat& points, Mat& neighbors )
for( j = 0; it != indices.end(); ++it, j++ ) for( j = 0; it != indices.end(); ++it, j++ )
neighbors1.at<int>(i,j) = *it; neighbors1.at<int>(i,j) = *it;
} }
// compare results // compare results
if( cvtest::norm( neighbors, neighbors1, NORM_L1 ) != 0 ) EXPECT_LE(cvtest::norm(neighbors, neighbors1, NORM_L1), 0);
return cvtest::TS::FAIL_BAD_ACCURACY;
return cvtest::TS::OK; return ::testing::Test::HasFailure() ? cvtest::TS::FAIL_BAD_ACCURACY : cvtest::TS::OK;
} }
void CV_FlannTest::releaseModel() void CV_FlannTest::releaseModel()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment