Commit 8b730a5a authored by Sebastien Alaiwan's avatar Sebastien Alaiwan Committed by James Zern

Avoid use of 'assert' in unit tests

A failing 'assert' aborts the execution of the test suite,
instead of simply failing the erroneous test, and continuing with other tests.

Change-Id: I3fdaf20a22ea343ac75be7883addbe6ba1e55da1
parent df971aa8
......@@ -63,7 +63,7 @@ TEST(av1_inv_txfm1d, round_trip) {
int32_t output[64];
int32_t round_trip_output[64];
assert(txfm_size <= NELEMENTS(input));
ASSERT_LE(txfm_size, NELEMENTS(input));
for (int ni = 0; ni < txfm_size; ++ni) {
input[ni] = rnd.Rand16() % input_base - rnd.Rand16() % input_base;
......
......@@ -56,7 +56,7 @@ class AV1InvTxfm2d : public ::testing::TestWithParam<AV1InvTxfm2dParam> {
for (int ci = 0; ci < count; ci++) {
int16_t expected[64 * 64] = { 0 };
assert(txfm2d_size_ < NELEMENTS(expected));
ASSERT_LT(txfm2d_size_, NELEMENTS(expected));
for (int ni = 0; ni < txfm2d_size_; ++ni) {
if (ci == 0) {
......@@ -68,11 +68,11 @@ class AV1InvTxfm2d : public ::testing::TestWithParam<AV1InvTxfm2dParam> {
}
int32_t coeffs[64 * 64] = { 0 };
assert(txfm2d_size_ < NELEMENTS(coeffs));
ASSERT_LT(txfm2d_size_, NELEMENTS(coeffs));
fwd_txfm_func(expected, coeffs, txfm1d_size_, tx_type_, bd);
uint16_t actual[64 * 64] = { 0 };
assert(txfm2d_size_ < NELEMENTS(actual));
ASSERT_LT(txfm2d_size_, NELEMENTS(actual));
inv_txfm_func(coeffs, actual, txfm1d_size_, tx_type_, bd);
for (int ni = 0; ni < txfm2d_size_; ++ni) {
......
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