From 96d6da4e252b06dcfdc041e7df23e86161c33007 Mon Sep 17 00:00:00 2001 From: rihab kouki Date: Tue, 28 Jul 2020 11:24:49 +0100 Subject: Official ARM version: v5.6.0 --- .../Common/inc/templates/test_templates.h | 62 ++++++++++++---------- 1 file changed, 35 insertions(+), 27 deletions(-) (limited to 'DSP/DSP_Lib_TestSuite/Common/inc/templates') diff --git a/DSP/DSP_Lib_TestSuite/Common/inc/templates/test_templates.h b/DSP/DSP_Lib_TestSuite/Common/inc/templates/test_templates.h index 69c3488..3badc80 100644 --- a/DSP/DSP_Lib_TestSuite/Common/inc/templates/test_templates.h +++ b/DSP/DSP_Lib_TestSuite/Common/inc/templates/test_templates.h @@ -62,25 +62,29 @@ /** * Assert that buffers A and B are byte-equivalent for a number of bytes. */ -#define TEST_ASSERT_BUFFERS_EQUAL(buf_a, buf_b, bytes) \ - do \ - { \ - if (memcmp(buf_a, buf_b, bytes) != 0) \ - { \ - return JTEST_TEST_FAILED; \ - } \ + +#define TEST_ASSERT_BUFFERS_EQUAL(buf_a, buf_b, bytes)\ + do \ + { \ + if (memcmp(buf_a, buf_b, bytes) != 0) \ + { \ + return JTEST_TEST_FAILED; \ + } \ } while (0) + + + /** * Assert that the two entities are equal. */ -#define TEST_ASSERT_EQUAL(a, b) \ - do \ - { \ - if ((a) != (b)) \ - { \ - return JTEST_TEST_FAILED; \ - } \ +#define TEST_ASSERT_EQUAL(a, b) \ + do \ + { \ + if ((a) != (b)) \ + { \ + return JTEST_TEST_FAILED;\ + } \ } while (0) /** @@ -111,31 +115,35 @@ * Assert that the SNR between a reference and test sample is above a given * threshold. */ -#define TEST_ASSERT_SNR(ref_ptr, tst_ptr, block_size, threshold) \ - do \ - { \ - float32_t snr = arm_snr_f32(ref_ptr, tst_ptr, block_size); \ - if ( snr <= threshold) \ - { \ - JTEST_DUMP_STRF("SNR: %f\n", snr); \ - return JTEST_TEST_FAILED; \ - } \ - } while (0) \ + +#define TEST_ASSERT_SNR(ref_ptr, tst_ptr, block_size, threshold) \ + do \ + { \ + float32_t snr = arm_snr_f32(ref_ptr, tst_ptr, block_size);\ + if ( snr <= threshold) \ + { \ + JTEST_DUMP_STRF("SNR: %f\n", snr); \ + return JTEST_TEST_FAILED; \ + } \ + } while (0) + /** * Assert that the SNR between a reference and test sample is above a given * threshold. Special case for float64_t */ -#define TEST_ASSERT_DBL_SNR(ref_ptr, tst_ptr, block_size, threshold) \ + +#define TEST_ASSERT_DBL_SNR(ref_ptr, tst_ptr, block_size, threshold)\ do \ { \ float64_t snr = arm_snr_f64(ref_ptr, tst_ptr, block_size); \ - if ( snr <= threshold) \ + if ( snr <= threshold) \ { \ JTEST_DUMP_STRF("SNR: %f\n", snr); \ return JTEST_TEST_FAILED; \ } \ - } while (0) \ + } while (0) + /** * Compare test and reference elements by converting to float and -- cgit