diff options
Diffstat (limited to 'test_data_manager.c')
-rw-r--r-- | test_data_manager.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test_data_manager.c b/test_data_manager.c index 56a9f9e..f21cc97 100644 --- a/test_data_manager.c +++ b/test_data_manager.c @@ -1,3 +1,5 @@ +#include <float.h> + #include "data_manager.h" #include "test_runner.h" #include "unity.h" @@ -6,16 +8,16 @@ RUNNER_DECLARE_TEST(test_data_manager_init_setting) { struct data_ctx ctx; data_manager_init(&ctx); - TEST_ASSERT_FLOAT_WITHIN(0.001, 1013.25, ctx.setting); + TEST_ASSERT_FLOAT_WITHIN(FLT_EPSILON, 1013.25, ctx.setting); } RUNNER_DECLARE_TEST(test_data_manager_first_readings) { struct data_ctx ctx; data_manager_init(&ctx); - TEST_ASSERT_FLOAT_WITHIN(0.001, 1019.5, ctx.pressure); + TEST_ASSERT_FLOAT_WITHIN(FLT_EPSILON, 1019.5, ctx.pressure); data_manager_tick(&ctx); - TEST_ASSERT_FLOAT_WITHIN(0.001, 1019.45, ctx.pressure); + TEST_ASSERT_FLOAT_WITHIN(FLT_EPSILON, 1019.45, ctx.pressure); } RUNNER_DECLARE_TEST(test_data_manager_reinit) @@ -23,9 +25,9 @@ RUNNER_DECLARE_TEST(test_data_manager_reinit) struct data_ctx ctx; /* init 1 */ data_manager_init(&ctx); - TEST_ASSERT_FLOAT_WITHIN(0.001, 1019.5, ctx.pressure); + TEST_ASSERT_FLOAT_WITHIN(FLT_EPSILON, 1019.5, ctx.pressure); /* check re-init */ data_manager_init(&ctx); - TEST_ASSERT_FLOAT_WITHIN(0.001, 1019.5, ctx.pressure); + TEST_ASSERT_FLOAT_WITHIN(FLT_EPSILON, 1019.5, ctx.pressure); } |