Skip to content

Commit 536a44e

Browse files
committed
checkasm/sw_range_convert: test negative input values
1 parent 6a108d4 commit 536a44e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/checkasm/sw_range_convert.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ static void check_lumConvertRange(int from)
6565

6666
LOCAL_ALIGNED_32(int16_t, dst0, [LARGEST_INPUT_SIZE * 2]);
6767
LOCAL_ALIGNED_32(int16_t, dst1, [LARGEST_INPUT_SIZE * 2]);
68+
int32_t *dst0_32 = (int32_t *) dst0;
69+
int32_t *dst1_32 = (int32_t *) dst1;
6870

6971
declare_func(void, int16_t *dst, int width);
7072

@@ -89,6 +91,11 @@ static void check_lumConvertRange(int from)
8991
int width = input_sizes[dstWi];
9092
if (check_func(c->lumConvertRange, "%s%d_%d", func_str, bit_depth, width)) {
9193
randomize_buffers(dst0, dst1, bit_depth, width);
94+
if (bit_depth == 16) {
95+
dst1_32[2] = dst0_32[2] = -1;
96+
} else {
97+
dst1[2] = dst0[2] = -1;
98+
}
9299
call_ref(dst0, width);
93100
call_new(dst1, width);
94101
if (memcmp(dst0, dst1, width * sample_size))
@@ -115,6 +122,8 @@ static void check_chrConvertRange(int from)
115122
LOCAL_ALIGNED_32(int16_t, dstV0, [LARGEST_INPUT_SIZE * 2]);
116123
LOCAL_ALIGNED_32(int16_t, dstU1, [LARGEST_INPUT_SIZE * 2]);
117124
LOCAL_ALIGNED_32(int16_t, dstV1, [LARGEST_INPUT_SIZE * 2]);
125+
int32_t *dstU0_32 = (int32_t *) dstU0;
126+
int32_t *dstU1_32 = (int32_t *) dstU1;
118127

119128
declare_func(void, int16_t *dstU, int16_t *dstV, int width);
120129

@@ -140,6 +149,11 @@ static void check_chrConvertRange(int from)
140149
if (check_func(c->chrConvertRange, "%s%d_%d", func_str, bit_depth, width)) {
141150
randomize_buffers(dstU0, dstU1, bit_depth, width);
142151
randomize_buffers(dstV0, dstV1, bit_depth, width);
152+
if (bit_depth == 16) {
153+
dstU1_32[2] = dstU0_32[2] = -1;
154+
} else {
155+
dstU1[2] = dstU0[2] = -1;
156+
}
143157
call_ref(dstU0, dstV0, width);
144158
call_new(dstU1, dstV1, width);
145159
if (memcmp(dstU0, dstU1, width * sample_size) ||

0 commit comments

Comments
 (0)