Get coverage of all code paths for routines that branch to different paths for different scaling ratios.
Showing the changes to test/processing/ProcessUT_DownSample.cpp (1 of 1 file). Show all
Unified · Split
| @@ -296,21 +296,23 @@ TEST (DownSampleTest, func) { \ · 295 unmodified lines | ||
| 296 | 296 | int src_stride_a; \ |
| 297 | 297 | int src_width_a; \ |
| 298 | 298 | int src_height_a; \ |
| 299 | − dst_stride_c = dst_stride_a = 320; \ | |
| 300 | − src_stride_c = src_stride_a = 320; \ | |
| 301 | − src_width_c = src_width_a = 320; \ | |
| 302 | − src_height_c = src_height_a = 180; \ | |
| 303 | − dst_width_c = dst_width_a = 300; \ | |
| 304 | − dst_height_c = dst_height_a = 160; \ | |
| 305 | − for (int j = 0; j < 70000; j++) { \ | |
| 306 | − dst_c[j] = dst_a[j] = rand() % 256; \ | |
| 307 | − src_c[j] = src_a[j] = rand() % 256; \ | |
| 308 | − } \ | |
| 309 | − ref (dst_c, dst_stride_c, dst_width_c, dst_height_c, src_c, src_stride_c, src_width_c, src_height_c); \ | |
| 310 | − func (dst_a, dst_stride_a, dst_width_a, dst_height_a, src_a, src_stride_a, src_width_a, src_height_a); \ | |
| 311 | − for (int j = 0; j < dst_height_c; j++) { \ | |
| 312 | − for (int m = 0; m < dst_width_c ; m++) { \ | |
| 313 | − ASSERT_EQ (dst_c[m + j * dst_stride_c], dst_a[m + j * dst_stride_a]); \ | |
| 299 | + for (int i = 0; i < 5; i++) { \ | |
| 300 | + dst_stride_c = dst_stride_a = 320; \ | |
| 301 | + src_stride_c = src_stride_a = 320; \ | |
| 302 | + src_width_c = src_width_a = 320; \ | |
| 303 | + src_height_c = src_height_a = 180; \ | |
| 304 | + dst_width_c = dst_width_a = (src_width_c >> (i + 1)) + rand() % (src_width_c >> (i + 1)); \ | |
| 305 | + dst_height_c = dst_height_a = 160; \ | |
| 306 | + for (int j = 0; j < 70000; j++) { \ | |
| 307 | + dst_c[j] = dst_a[j] = rand() % 256; \ | |
| 308 | + src_c[j] = src_a[j] = rand() % 256; \ | |
| 309 | + } \ | |
| 310 | + ref (dst_c, dst_stride_c, dst_width_c, dst_height_c, src_c, src_stride_c, src_width_c, src_height_c); \ | |
| 311 | + func (dst_a, dst_stride_a, dst_width_a, dst_height_a, src_a, src_stride_a, src_width_a, src_height_a); \ | |
| 312 | + for (int j = 0; j < dst_height_c; j++) { \ | |
| 313 | + for (int m = 0; m < dst_width_c ; m++) { \ | |
| 314 | + ASSERT_EQ (dst_c[m + j * dst_stride_c], dst_a[m + j * dst_stride_a]); \ | |
| 315 | + } \ | |
| 314 | 316 | } \ |
| 315 | 317 | } \ |
| 316 | 318 | } |