NearestNeighborTest: use ts->get_rng() instead of (implicit) theRNG()
authorRoman Donchenko <roman.donchenko@itseez.com>
Thu, 30 Jul 2015 15:03:48 +0000 (18:03 +0300)
committerAlexander Smorkalov <alexander.smorkalov@itseez.com>
Thu, 17 Sep 2015 10:37:26 +0000 (13:37 +0300)
This ensures that test data is not dependent on the order the tests are
executed in.

(cherry picked from commit 1245cd175283b11800bbbdc52287957cc3d76417)

modules/features2d/test/test_nearestneighbors.cpp

index 2c64e64..b63bc64 100644 (file)
@@ -125,7 +125,7 @@ int NearestNeighborTest::checkFind( const Mat& data )
 void NearestNeighborTest::run( int /*start_from*/ ) {
     int code = cvtest::TS::OK, tempCode;
     Mat desc( featuresCount, dims, CV_32FC1 );
-    randu( desc, Scalar(minValue), Scalar(maxValue) );
+    ts->get_rng().fill( desc, RNG::UNIFORM, minValue, maxValue );
 
     createModel( desc );