{cdef,reconinter}_test.cc: fix bitwise shift warning
Fixes some clang-19 static analysis warnings of the form:
```
The result of left shift is undefined because the right operand is
negative
```
Bug: 474642915
Change-Id: Iece63e7f972d506c0afee09ab5ff1e3758850f64
diff --git a/test/cdef_test.cc b/test/cdef_test.cc
index 6f985f0..df535ab 100644
--- a/test/cdef_test.cc
+++ b/test/cdef_test.cc
@@ -10,6 +10,7 @@
*/
#include <array>
+#include <cassert>
#include <cstdlib>
#include <iostream>
#include <string>
@@ -89,6 +90,7 @@
((bsize == BLOCK_8X8) || (bsize == BLOCK_8X4)) ? 8 : 4;
const int block_height =
((bsize == BLOCK_8X8) || (bsize == BLOCK_4X8)) ? 8 : 4;
+ assert(depth >= 8); // Suppress static analysis warning w/negative depth - 8.
const unsigned int max_pos = size * size >> static_cast<int>(depth == 8);
for (pridamping = 3 + depth - 8; pridamping < 7 - 3 * !!boundary + depth - 8;
pridamping++) {
diff --git a/test/reconinter_test.cc b/test/reconinter_test.cc
index 91bf720..2bfa074 100644
--- a/test/reconinter_test.cc
+++ b/test/reconinter_test.cc
@@ -267,6 +267,8 @@
const int in_precision =
bd + 2 * FILTER_BITS - conv_params.round_0 - conv_params.round_1 + 2;
+ ASSERT_GT(in_precision, 0);
+ ASSERT_LE(in_precision, 18);
for (int i = 0; i < MAX_SB_SQUARE; i++) {
src0[i] = rnd_.Rand16() & ((1 << in_precision) - 1);
@@ -308,6 +310,8 @@
const int in_precision =
bd + 2 * FILTER_BITS - conv_params.round_0 - conv_params.round_1 + 2;
+ ASSERT_GT(in_precision, 0);
+ ASSERT_LE(in_precision, 18);
for (int i = 0; i < MAX_SB_SQUARE; i++) {
src0[i] = rnd_.Rand16() & ((1 << in_precision) - 1);