summaryrefslogtreecommitdiff
path: root/fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/src/support_tests/x_to_y_tests.c
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2020-10-14 12:49:08 +0200
committerjaseg <git@jaseg.net>2020-10-14 12:49:08 +0200
commit3559d845d29272050d4d44e18e0bb84e676e48ff (patch)
treed8d6ce99e40b1a3745d76f0c9aac2f10e7286481 /fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/src/support_tests/x_to_y_tests.c
parent491b2acaaa9db1798445f3e174e68ada7424fc33 (diff)
parent6ab94e0b318884bbcb95e2ea3835f951502e1d99 (diff)
downloadminikbd-3559d845d29272050d4d44e18e0bb84e676e48ff.tar.gz
minikbd-3559d845d29272050d4d44e18e0bb84e676e48ff.tar.bz2
minikbd-3559d845d29272050d4d44e18e0bb84e676e48ff.zip
Merge firmware and pcb repos
Diffstat (limited to 'fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/src/support_tests/x_to_y_tests.c')
-rw-r--r--fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/src/support_tests/x_to_y_tests.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/src/support_tests/x_to_y_tests.c b/fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/src/support_tests/x_to_y_tests.c
new file mode 100644
index 0000000..4667031
--- /dev/null
+++ b/fw/cdc-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/src/support_tests/x_to_y_tests.c
@@ -0,0 +1,80 @@
+#include "jtest.h"
+#include "support_test_data.h"
+#include "arr_desc.h"
+#include "arm_math.h" /* FUTs */
+#include "ref.h" /* Reference Functions */
+#include "test_templates.h"
+#include "support_templates.h"
+#include "type_abbrev.h"
+
+/* Aliases to play nicely with templates. */
+#define arm_f32_to_q31 arm_float_to_q31
+#define arm_f32_to_q15 arm_float_to_q15
+#define arm_f32_to_q7 arm_float_to_q7
+#define arm_q31_to_f32 arm_q31_to_float
+#define arm_q15_to_f32 arm_q15_to_float
+#define arm_q7_to_f32 arm_q7_to_float
+#define ref_f32_to_q31 ref_float_to_q31
+#define ref_f32_to_q15 ref_float_to_q15
+#define ref_f32_to_q7 ref_float_to_q7
+#define ref_q31_to_f32 ref_q31_to_float
+#define ref_q15_to_f32 ref_q15_to_float
+#define ref_q7_to_f32 ref_q7_to_float
+
+#define JTEST_ARM_X_TO_Y_TEST(prefix, suffix) \
+ JTEST_DEFINE_TEST(arm_##prefix##_to_##suffix##_test, \
+ arm_##prefix##_to_##suffix) \
+ { \
+ TEST_TEMPLATE_BUF1_BLK( \
+ support_f_all, \
+ support_block_sizes, \
+ TYPE_FROM_ABBREV(prefix), \
+ TYPE_FROM_ABBREV(suffix), \
+ arm_##prefix##_to_##suffix, \
+ ARM_x_to_y_INPUT_INTERFACE, \
+ ref_##prefix##_to_##suffix, \
+ REF_x_to_y_INPUT_INTERFACE, \
+ SUPPORT_COMPARE_INTERFACE); \
+ }
+
+JTEST_ARM_X_TO_Y_TEST(f32, q31);
+JTEST_ARM_X_TO_Y_TEST(f32, q15);
+JTEST_ARM_X_TO_Y_TEST(f32, q7);
+
+JTEST_ARM_X_TO_Y_TEST(q31, f32);
+JTEST_ARM_X_TO_Y_TEST(q31, q15);
+JTEST_ARM_X_TO_Y_TEST(q31, q7);
+
+JTEST_ARM_X_TO_Y_TEST(q15, f32);
+JTEST_ARM_X_TO_Y_TEST(q15, q31);
+JTEST_ARM_X_TO_Y_TEST(q15, q7);
+
+JTEST_ARM_X_TO_Y_TEST(q7, f32);
+JTEST_ARM_X_TO_Y_TEST(q7, q31);
+JTEST_ARM_X_TO_Y_TEST(q7, q15);
+
+/*--------------------------------------------------------------------------------*/
+/* Collect all tests in a group. */
+/*--------------------------------------------------------------------------------*/
+
+JTEST_DEFINE_GROUP(x_to_y_tests)
+{
+ /*
+ To skip a test, comment it out.
+ */
+ JTEST_TEST_CALL(arm_f32_to_q31_test);
+ JTEST_TEST_CALL(arm_f32_to_q15_test);
+ JTEST_TEST_CALL(arm_f32_to_q7_test);
+
+ JTEST_TEST_CALL(arm_q31_to_f32_test);
+ JTEST_TEST_CALL(arm_q31_to_q15_test);
+ JTEST_TEST_CALL(arm_q31_to_q7_test);
+
+ JTEST_TEST_CALL(arm_q15_to_f32_test);
+ JTEST_TEST_CALL(arm_q15_to_q31_test);
+ JTEST_TEST_CALL(arm_q15_to_q7_test);
+
+ JTEST_TEST_CALL(arm_q7_to_f32_test);
+ JTEST_TEST_CALL(arm_q7_to_q31_test);
+ JTEST_TEST_CALL(arm_q7_to_q15_test);
+}