Check for empty Mat in compare, operator= and RNG::fill, fixed related tests

This commit is contained in:
Maksim Shabunin
2018-07-17 17:50:50 +03:00
parent 1da46fe6fb
commit c473718bc2
5 changed files with 8 additions and 4 deletions
+3 -2
View File
@@ -168,11 +168,12 @@ void Core_RandTest::run( int )
{
tested_rng = saved_rng;
int sz = 0, dsz = 0, slice;
for( slice = 0; slice < maxSlice; slice++, sz += dsz )
for( slice = 0; slice < maxSlice && sz < SZ; slice++, sz += dsz )
{
dsz = slice+1 < maxSlice ? (int)(cvtest::randInt(rng) % (SZ - sz + 1)) : SZ - sz;
dsz = slice+1 < maxSlice ? (int)(cvtest::randInt(rng) % (SZ - sz) + 1) : SZ - sz;
Mat aslice = arr[k].colRange(sz, sz + dsz);
tested_rng.fill(aslice, dist_type, A, B);
printf("%d - %d\n", sz, sz + dsz);
}
}