Commit 7866d8e0 authored by fbarchard@google.com's avatar fbarchard@google.com

Make unittest check every pixel and report the first failure.

BUG=269
TESTED=unittest passes on windows
R=harryjin@google.com

Review URL: https://webrtc-codereview.appspot.com/36509004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1203 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 7892ea1f
...@@ -655,18 +655,14 @@ TEST_F(libyuvTest, FMT_A##To##FMT_PLANAR##N) { \ ...@@ -655,18 +655,14 @@ TEST_F(libyuvTest, FMT_A##To##FMT_PLANAR##N) { \
dst_v_opt, SUBSAMPLE(kWidth, SUBSAMP_X), \ dst_v_opt, SUBSAMPLE(kWidth, SUBSAMP_X), \
kWidth, NEG kHeight); \ kWidth, NEG kHeight); \
} \ } \
int max_diff = 0; \
for (int i = 0; i < kHeight; ++i) { \ for (int i = 0; i < kHeight; ++i) { \
for (int j = 0; j < kWidth; ++j) { \ for (int j = 0; j < kWidth; ++j) { \
int abs_diff = \ int abs_diff = \
abs(static_cast<int>(dst_y_c[i * kWidth + j]) - \ abs(static_cast<int>(dst_y_c[i * kWidth + j]) - \
static_cast<int>(dst_y_opt[i * kWidth + j])); \ static_cast<int>(dst_y_opt[i * kWidth + j])); \
if (abs_diff > max_diff) { \ EXPECT_LE(abs_diff, DIFF); \
max_diff = abs_diff; \
} \
} \ } \
} \ } \
EXPECT_LE(max_diff, DIFF); \
for (int i = 0; i < SUBSAMPLE(kHeight, SUBSAMP_Y); ++i) { \ for (int i = 0; i < SUBSAMPLE(kHeight, SUBSAMP_Y); ++i) { \
for (int j = 0; j < SUBSAMPLE(kWidth, SUBSAMP_X); ++j) { \ for (int j = 0; j < SUBSAMPLE(kWidth, SUBSAMP_X); ++j) { \
int abs_diff = \ int abs_diff = \
...@@ -674,12 +670,9 @@ TEST_F(libyuvTest, FMT_A##To##FMT_PLANAR##N) { \ ...@@ -674,12 +670,9 @@ TEST_F(libyuvTest, FMT_A##To##FMT_PLANAR##N) { \
SUBSAMPLE(kWidth, SUBSAMP_X) + j]) - \ SUBSAMPLE(kWidth, SUBSAMP_X) + j]) - \
static_cast<int>(dst_u_opt[i * \ static_cast<int>(dst_u_opt[i * \
SUBSAMPLE(kWidth, SUBSAMP_X) + j])); \ SUBSAMPLE(kWidth, SUBSAMP_X) + j])); \
if (abs_diff > max_diff) { \ EXPECT_LE(abs_diff, DIFF); \
max_diff = abs_diff; \
} \
} \ } \
} \ } \
EXPECT_LE(max_diff, DIFF); \
for (int i = 0; i < SUBSAMPLE(kHeight, SUBSAMP_Y); ++i) { \ for (int i = 0; i < SUBSAMPLE(kHeight, SUBSAMP_Y); ++i) { \
for (int j = 0; j < SUBSAMPLE(kWidth, SUBSAMP_X); ++j) { \ for (int j = 0; j < SUBSAMPLE(kWidth, SUBSAMP_X); ++j) { \
int abs_diff = \ int abs_diff = \
...@@ -687,12 +680,9 @@ TEST_F(libyuvTest, FMT_A##To##FMT_PLANAR##N) { \ ...@@ -687,12 +680,9 @@ TEST_F(libyuvTest, FMT_A##To##FMT_PLANAR##N) { \
SUBSAMPLE(kWidth, SUBSAMP_X) + j]) - \ SUBSAMPLE(kWidth, SUBSAMP_X) + j]) - \
static_cast<int>(dst_v_opt[i * \ static_cast<int>(dst_v_opt[i * \
SUBSAMPLE(kWidth, SUBSAMP_X) + j])); \ SUBSAMPLE(kWidth, SUBSAMP_X) + j])); \
if (abs_diff > max_diff) { \ EXPECT_LE(abs_diff, DIFF); \
max_diff = abs_diff; \
} \
} \ } \
} \ } \
EXPECT_LE(max_diff, DIFF); \
free_aligned_buffer_64(dst_y_c); \ free_aligned_buffer_64(dst_y_c); \
free_aligned_buffer_64(dst_u_c); \ free_aligned_buffer_64(dst_u_c); \
free_aligned_buffer_64(dst_v_c); \ free_aligned_buffer_64(dst_v_c); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment