1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge pull request #21107 from take1014:remove_assert_21038

resolves #21038

* remove C assert

* revert C header

* fix several points in review

* fix test_ds.cpp
This commit is contained in:
yuki takehara
2021-11-28 03:34:52 +09:00
committed by GitHub
parent b55d8f46f4
commit a6277370ca
81 changed files with 277 additions and 286 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ namespace perf {
void checkDeviceMaxMemoryAllocSize(const Size& size, int type, int factor)
{
assert(factor > 0);
CV_Assert(factor > 0);
if (!cv::ocl::useOpenCL())
return;
+1 -1
View File
@@ -377,7 +377,7 @@ void BaseTest::run( int start_from )
void BaseTest::run_func(void)
{
assert(0);
CV_Assert(0);
}
+3 -3
View File
@@ -268,14 +268,14 @@ void ArrayTest::fill_array( int /*test_case_idx*/, int i, int j, Mat& arr )
double ArrayTest::get_success_error_level( int /*test_case_idx*/, int i, int j )
{
int elem_depth = CV_MAT_DEPTH(cvGetElemType(test_array[i][j]));
assert( i == OUTPUT || i == INPUT_OUTPUT );
CV_Assert( i == OUTPUT || i == INPUT_OUTPUT );
return elem_depth < CV_32F ? 0 : elem_depth == CV_32F ? FLT_EPSILON*100: DBL_EPSILON*5000;
}
void ArrayTest::prepare_to_validation( int /*test_case_idx*/ )
{
assert(0);
CV_Assert(0);
}
@@ -293,7 +293,7 @@ int ArrayTest::validate_test_results( int test_case_idx )
int i1 = i == 0 ? REF_OUTPUT : REF_INPUT_OUTPUT;
size_t sizei = test_array[i0].size();
assert( sizei == test_array[i1].size() );
CV_Assert( sizei == test_array[i1].size() );
for( j = 0; j < sizei; j++ )
{
double err_level;
+4 -4
View File
@@ -2094,7 +2094,7 @@ int cmpEps( const Mat& arr, const Mat& refarr, double* _realmaxdiff,
}
break;
default:
assert(0);
CV_Assert(0);
return CMP_EPS_BIG_DIFF;
}
if(_realmaxdiff)
@@ -2705,7 +2705,7 @@ static void calcSobelKernel1D( int order, int _aperture_size, int size, vector<i
if( _aperture_size < 0 )
{
static const int scharr[8] = { 3, 10, 3, -1, 0, 1, 0, 0 }; // extra elements to eliminate "-Warray-bounds" bogus warning
assert( size == 3 );
CV_Assert( size == 3 && order < 2 );
for( i = 0; i < size; i++ )
kernel[i] = scharr[order*3 + i];
return;
@@ -2999,7 +2999,7 @@ void threshold( const Mat& _src, Mat& _dst,
imaxval = cvRound(maxval);
}
assert( depth == CV_8U || depth == CV_16S || depth == CV_32F );
CV_Assert( depth == CV_8U || depth == CV_16S || depth == CV_32F );
switch( thresh_type )
{
@@ -3161,7 +3161,7 @@ void threshold( const Mat& _src, Mat& _dst,
}
break;
default:
assert(0);
CV_Assert(0);
}
}
+4 -4
View File
@@ -1366,7 +1366,7 @@ bool TestBase::next()
bool has_next = false;
do {
assert(currentIter == times.size());
CV_Assert(currentIter == times.size());
if (currentIter == 0)
{
has_next = true;
@@ -1379,7 +1379,7 @@ bool TestBase::next()
}
else
{
assert(getCurrentPerformanceStrategy() == PERF_STRATEGY_SIMPLE);
CV_Assert(getCurrentPerformanceStrategy() == PERF_STRATEGY_SIMPLE);
if (totalTime - lastActivityPrintTime >= cv::getTickFrequency() * 10)
{
std::cout << '.' << std::endl;
@@ -1638,7 +1638,7 @@ performance_metrics& TestBase::calcMetrics()
}
else
{
assert(false);
CV_Assert(false);
}
int offset = static_cast<int>(start - times.begin());
@@ -1714,7 +1714,7 @@ void TestBase::validateMetrics()
}
else
{
assert(false);
CV_Assert(false);
}
}