From 079d7e9a1a2ab33c06b524b75edf7d1cadecc26c Mon Sep 17 00:00:00 2001 From: Joose Sainio Date: Tue, 26 Sep 2023 11:36:43 +0300 Subject: [PATCH] [tests] Fix mts_tests.c to not consider irrelevant elements --- tests/mts_tests.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/mts_tests.c b/tests/mts_tests.c index b417aa35..61f9fb2c 100644 --- a/tests/mts_tests.c +++ b/tests/mts_tests.c @@ -158,6 +158,7 @@ TEST dct(void) { char testname[100]; for (int blocksize = 0; blocksize < NUM_SIZES; blocksize++) { + size_t size = 1 << (LCU_MIN_LOG_W + blocksize); for (int trafo = 0; trafo < NUM_TRANSFORM; trafo++) { sprintf(testname, "Block: %d x %d, trafo: %d", 1 << (LCU_MIN_LOG_W + blocksize), 1 << (LCU_MIN_LOG_W + blocksize), trafo); cu_info_t tu; @@ -172,8 +173,13 @@ TEST dct(void) test_env.tested_func(UVG_BIT_DEPTH, COLOR_Y, &tu, 1 << (LCU_MIN_LOG_W + blocksize), 1 << (LCU_MIN_LOG_W + blocksize), buf, test_result, UVG_MTS_BOTH); - for (int i = 0; i < LCU_WIDTH * LCU_WIDTH; ++i) { - ASSERT_EQm(testname, test_result[i], dct_result[trafo][blocksize][i]); + for (int y = 0; y < size; ++y) { + if (y>= 16) break; + for (int x = 0; x < size; ++x) { + if (x >= 16) break; + int i = y * size + x; + ASSERT_EQm(testname, test_result[i], dct_result[trafo][blocksize][i]); + } } //fprintf(stderr, "PASS: %s\r\n", testname); }