1
0
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:
Alexander Alekhin
2016-12-12 14:22:52 +03:00
parent 2fded5d8fb
commit 03bcfe4107
4 changed files with 11 additions and 3 deletions
+3 -1
View File
@@ -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&);
+3 -1
View File
@@ -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 \
{ \