mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
test: fix RNG problem in accuracy tests
This commit is contained in:
@@ -539,11 +539,13 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
extern uint64 param_seed;
|
||||
|
||||
struct CV_EXPORTS DefaultRngAuto
|
||||
{
|
||||
const uint64 old_state;
|
||||
|
||||
DefaultRngAuto() : old_state(cv::theRNG().state) { cv::theRNG().state = (uint64)-1; }
|
||||
DefaultRngAuto() : old_state(cv::theRNG().state) { cv::theRNG().state = cvtest::param_seed; }
|
||||
~DefaultRngAuto() { cv::theRNG().state = old_state; }
|
||||
|
||||
DefaultRngAuto& operator=(const DefaultRngAuto&);
|
||||
|
||||
@@ -12,7 +12,9 @@ namespace cvtest {
|
||||
void checkIppStatus();
|
||||
}
|
||||
|
||||
#define CV_TEST_INIT cv::ipp::setIppStatus(0);
|
||||
#define CV_TEST_INIT \
|
||||
cv::ipp::setIppStatus(0); \
|
||||
cv::theRNG().state = cvtest::param_seed;
|
||||
#define CV_TEST_CLEANUP ::cvtest::checkIppStatus();
|
||||
#define CV_TEST_BODY_IMPL \
|
||||
{ \
|
||||
|
||||
Reference in New Issue
Block a user