summaryrefslogtreecommitdiff
path: root/DSP/DSP_Lib_TestSuite/Common/inc
diff options
context:
space:
mode:
authorrihab kouki <rihab.kouki@st.com>2020-07-28 11:24:49 +0100
committerrihab kouki <rihab.kouki@st.com>2020-07-28 11:24:49 +0100
commit96d6da4e252b06dcfdc041e7df23e86161c33007 (patch)
treea262f59bb1db7ec7819acae435f5049cbe5e2354 /DSP/DSP_Lib_TestSuite/Common/inc
parent9f95ff5b6ba01db09552b84a0ab79607060a2666 (diff)
downloadst-cmsis-core-lowfat-master.tar.gz
st-cmsis-core-lowfat-master.tar.bz2
st-cmsis-core-lowfat-master.zip
Official ARM version: v5.6.0HEADmaster
Diffstat (limited to 'DSP/DSP_Lib_TestSuite/Common/inc')
-rw-r--r--DSP/DSP_Lib_TestSuite/Common/inc/templates/test_templates.h62
1 files changed, 35 insertions, 27 deletions
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