From 8d56b254f5d432aad44968ee2ed5a6e9072a426e Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 27 Aug 2018 11:19:20 +0200 Subject: [PATCH] Fixed vector test failure criteria for conversions --- lib/src/phy/utils/test/vector_test.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/src/phy/utils/test/vector_test.c b/lib/src/phy/utils/test/vector_test.c index 85b1c3fb9..35156acaa 100644 --- a/lib/src/phy/utils/test/vector_test.c +++ b/lib/src/phy/utils/test/vector_test.c @@ -448,8 +448,11 @@ TEST(srslte_vec_convert_fi, TEST_CALL(srslte_vec_convert_fi(x, scale, z, block_size)) for (int i = 0; i < block_size; i++) { - gold = (short) ((x[i] * scale)); - mse += cabsf((float)gold - (float) z[i]); + gold = (short) ((x[i] * scale)); + double err = cabsf((float)gold - (float) z[i]); + if (err > mse) { + mse = err; + } } free(x); @@ -470,8 +473,11 @@ TEST(srslte_vec_convert_if, TEST_CALL(srslte_vec_convert_if(x, scale, z, block_size)) for (int i = 0; i < block_size; i++) { - gold = ((float)x[i]) * k; - mse += fabsf(gold - z[i]); + gold = ((float)x[i]) * k; + double err = cabsf((float)gold - (float) z[i]); + if (err > mse) { + mse = err; + } } free(x);