Merge pull request #25723 from mshabunin:fix-ts-rng

test: use cv::theRNG instead of own generator
pull/25731/head
Alexander Smorkalov 6 months ago committed by GitHub
commit 3282954c2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      modules/core/test/test_math.cpp
  2. 3
      modules/ts/include/opencv2/ts.hpp
  3. 5
      modules/ts/src/ts.cpp

@ -135,7 +135,7 @@ double Core_PowTest::get_success_error_level( int test_case_idx, int i, int j )
return power == cvRound(power) && power >= 0 ? 0 : 1;
else
{
return depth != CV_64F ? Base::get_success_error_level( test_case_idx, i, j ) : DBL_EPSILON*1024*1.1;
return depth != CV_64F ? Base::get_success_error_level( test_case_idx, i, j ) : DBL_EPSILON*1024*1.11;
}
}

@ -611,7 +611,7 @@ public:
};
// get RNG to generate random input data for a test
RNG& get_rng() { return rng; }
RNG& get_rng() { return cv::theRNG(); }
// returns the current error code
TS::FailureCode get_err_code() { return TS::FailureCode(current_test_info.code); }
@ -629,7 +629,6 @@ public:
protected:
// these are allocated within a test to try to keep them valid in case of stack corruption
RNG rng;
// information about the current test
TestInfo current_test_info;

@ -591,8 +591,6 @@ void TS::init( const string& modulename )
if( params.use_optimized == 0 )
cv::setUseOptimized(false);
rng = RNG(params.rng_seed);
}
@ -635,9 +633,6 @@ void TS::update_context( BaseTest* test, int test_case_idx, bool update_ts_conte
{
current_test_info.rng_seed = param_seed + test_case_idx;
current_test_info.rng_seed0 = current_test_info.rng_seed;
rng = RNG(current_test_info.rng_seed);
cv::theRNG() = rng;
}
current_test_info.test = test;

Loading…
Cancel
Save