summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/math_util.c2
-rw-r--r--test/motion_lid.c13
2 files changed, 8 insertions, 7 deletions
diff --git a/test/math_util.c b/test/math_util.c
index 46087e9f33..e563d8dd02 100644
--- a/test/math_util.c
+++ b/test/math_util.c
@@ -37,7 +37,7 @@ static int test_acos(void)
/* Test a handful of values. */
for (test = -1.0; test <= 1.0; test += 0.01) {
- a = arc_cos(test);
+ a = FP_TO_FLOAT(arc_cos(FLOAT_TO_FP(test)));
b = acos(test) * RAD_TO_DEG;
TEST_ASSERT(IS_FLOAT_EQUAL(a, b, ACOS_TOLERANCE_DEG));
}
diff --git a/test/motion_lid.c b/test/motion_lid.c
index e0f1e68e7c..a358a5056c 100644
--- a/test/motion_lid.c
+++ b/test/motion_lid.c
@@ -6,6 +6,7 @@
*/
#include <math.h>
+#include <stdio.h>
#include "accelgyro.h"
#include "common.h"
@@ -89,15 +90,15 @@ const struct accelgyro_drv test_motion_sense = {
};
const matrix_3x3_t base_standard_ref = {
- { 1, 0, 0},
- { 0, 1, 0},
- { 0, 0, 1}
+ { FLOAT_TO_FP(1), 0, 0},
+ { 0, FLOAT_TO_FP(1), 0},
+ { 0, 0, FLOAT_TO_FP(1)}
};
const matrix_3x3_t lid_standard_ref = {
- { 1, 0, 0},
- { 1, 0, 0},
- { 0, 0, 1}
+ { FLOAT_TO_FP(1), 0, 0},
+ { FLOAT_TO_FP(1), 0, 0},
+ { 0, 0, FLOAT_TO_FP(1)}
};
struct motion_sensor_t motion_sensors[] = {