diff options
Diffstat (limited to 'test/math_util.c')
-rw-r--r-- | test/math_util.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/test/math_util.c b/test/math_util.c index 6482888e55..1ee9b1484b 100644 --- a/test/math_util.c +++ b/test/math_util.c @@ -1,4 +1,4 @@ -/* Copyright 2014 The Chromium OS Authors. All rights reserved. +/* Copyright 2014 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * @@ -25,7 +25,7 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); /* Test utilities */ /* Macro to compare two floats and check if they are equal within diff. */ -#define IS_FLOAT_EQUAL(a, b, diff) ((a) >= ((b) - diff) && (a) <= ((b) + diff)) +#define IS_FLOAT_EQUAL(a, b, diff) ((a) >= ((b)-diff) && (a) <= ((b) + diff)) #define ACOS_TOLERANCE_DEG 0.5f #define RAD_TO_DEG (180.0f / 3.1415926f) @@ -45,21 +45,19 @@ static int test_acos(void) return EC_SUCCESS; } - const mat33_fp_t test_matrices[] = { - {{ 0, FLOAT_TO_FP(-1), 0}, - {FLOAT_TO_FP(-1), 0, 0}, - { 0, 0, FLOAT_TO_FP(1)} }, - {{ FLOAT_TO_FP(1), 0, FLOAT_TO_FP(5)}, - { FLOAT_TO_FP(2), FLOAT_TO_FP(1), FLOAT_TO_FP(6)}, - { FLOAT_TO_FP(3), FLOAT_TO_FP(4), 0} } + { { 0, FLOAT_TO_FP(-1), 0 }, + { FLOAT_TO_FP(-1), 0, 0 }, + { 0, 0, FLOAT_TO_FP(1) } }, + { { FLOAT_TO_FP(1), 0, FLOAT_TO_FP(5) }, + { FLOAT_TO_FP(2), FLOAT_TO_FP(1), FLOAT_TO_FP(6) }, + { FLOAT_TO_FP(3), FLOAT_TO_FP(4), 0 } } }; - static int test_rotate(void) { int i, j, k; - intv3_t v = {1, 2, 3}; + intv3_t v = { 1, 2, 3 }; intv3_t w; for (i = 0; i < ARRAY_SIZE(test_matrices); i++) { @@ -122,7 +120,7 @@ test_static int test_temp_conversion(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); |