test: fix Core_ArithmMask.uninitialized test
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Wed, 7 Dec 2016 18:39:29 +0000 (21:39 +0300)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Wed, 7 Dec 2016 18:44:17 +0000 (21:44 +0300)
Don't run binary operations for floating-point numbers
norm() will fail with NAN result.

modules/core/test/test_arithm.cpp

index ab14016..0781fd1 100644 (file)
@@ -1496,7 +1496,7 @@ TEST(Core_ArithmMask, uninitialized)
                 int depth = rng.uniform(CV_8U, CV_64F+1);
                 int cn = rng.uniform(1, 6);
                 int type = CV_MAKETYPE(depth, cn);
-                int op = rng.uniform(0, 5);
+                int op = rng.uniform(0, depth < CV_32F ? 5 : 2); // don't run binary operations between floating-point values
                 int depth1 = op <= 1 ? CV_64F : depth;
                 for (int k = 0; k < MAX_DIM; k++)
                 {