mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge pull request #25723 from mshabunin:fix-ts-rng
test: use cv::theRNG instead of own generator
This commit is contained in:
commit
3282954c2e
@ -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;
|
return power == cvRound(power) && power >= 0 ? 0 : 1;
|
||||||
else
|
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
|
// 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
|
// returns the current error code
|
||||||
TS::FailureCode get_err_code() { return TS::FailureCode(current_test_info.code); }
|
TS::FailureCode get_err_code() { return TS::FailureCode(current_test_info.code); }
|
||||||
@ -629,7 +629,6 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
// these are allocated within a test to try to keep them valid in case of stack corruption
|
// these are allocated within a test to try to keep them valid in case of stack corruption
|
||||||
RNG rng;
|
|
||||||
|
|
||||||
// information about the current test
|
// information about the current test
|
||||||
TestInfo current_test_info;
|
TestInfo current_test_info;
|
||||||
|
@ -591,8 +591,6 @@ void TS::init( const string& modulename )
|
|||||||
|
|
||||||
if( params.use_optimized == 0 )
|
if( params.use_optimized == 0 )
|
||||||
cv::setUseOptimized(false);
|
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_seed = param_seed + test_case_idx;
|
||||||
current_test_info.rng_seed0 = current_test_info.rng_seed;
|
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;
|
current_test_info.test = test;
|
||||||
|
Loading…
Reference in New Issue
Block a user