Subversion Repositories dashGPS

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include "jtest.h"
  2. #include "matrix_test_data.h"
  3. #include "arr_desc.h"
  4. #include "arm_math.h"           /* FUTs */
  5. #include "ref.h"                /* Reference Functions */
  6. #include "test_templates.h"
  7. #include "matrix_templates.h"
  8. #include "type_abbrev.h"
  9.  
  10. #define JTEST_ARM_MAT_INIT_TEST(suffix)                     \
  11.     JTEST_DEFINE_TEST(arm_mat_init_##suffix##_test,         \
  12.                       arm_mat_init_##suffix)                \
  13.     {                                                       \
  14.         const uint16_t rows = 4;                            \
  15.         const uint16_t cols = 2;                            \
  16.         arm_matrix_instance_##suffix  matrix = {0};         \
  17.         /*  TYPE_FROM_ABBREV(suffix) data[rows*cols] = {0}; */ \
  18.             TYPE_FROM_ABBREV(suffix) data[4*2] = {0}; \
  19.                                                             \
  20.             arm_mat_init_##suffix(&matrix,                  \
  21.                                   rows,                     \
  22.                                   cols,                     \
  23.                                   data);                    \
  24.                                                             \
  25.                 JTEST_DUMP_STRF("Matrix Dimensions: %dx%d\n", \
  26.                      (int)matrix.numRows,                   \
  27.                      (int)matrix.numCols);                  \
  28.                                                             \
  29.                 if ((matrix.numRows == rows) &&             \
  30.                     (matrix.numCols == cols) &&             \
  31.                     (matrix.pData == data))                 \
  32.                 {                                           \
  33.                     return JTEST_TEST_PASSED;               \
  34.                 }                                           \
  35.                 else                                        \
  36.                 {                                           \
  37.                     return JTEST_TEST_FAILED;               \
  38.                 }                                           \
  39.                                                             \
  40.     }
  41.  
  42. JTEST_ARM_MAT_INIT_TEST(f32);
  43. JTEST_ARM_MAT_INIT_TEST(q31);
  44. JTEST_ARM_MAT_INIT_TEST(q15);
  45.  
  46. /*--------------------------------------------------------------------------------*/
  47. /* Collect all tests in a group. */
  48. /*--------------------------------------------------------------------------------*/
  49.  
  50. JTEST_DEFINE_GROUP(mat_init_tests)
  51. {
  52.     /*
  53.       To skip a test, comment it out.
  54.     */
  55.     JTEST_TEST_CALL(arm_mat_init_f32_test);
  56.     JTEST_TEST_CALL(arm_mat_init_q31_test);
  57.     JTEST_TEST_CALL(arm_mat_init_q15_test);
  58. }
  59.