From 0c88e55fa8f132e8ac15426911d155f136078302 Mon Sep 17 00:00:00 2001 From: Martin Baƙinka Date: Mon, 3 May 2021 12:43:54 +0200 Subject: fixed division, undefined behaviors and some improvements (#33) * testing using ctest * emove old testing script * added github workflow CI * updated CI * added unit test for macros * F16() and F16C() are both rounding allways, so fix16_from_dbl should as well * added tests for strign operations, but these functions are in my opinion unreliable and tests are failing * removed old unittests * removed old unittests from cmake * problem with division using gcc * improved benchmark * clarification of problem with division * attempt to fix * fixed some undefined behaviors, fixed division --- tests/tests_basic.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/tests_basic.c') diff --git a/tests/tests_basic.c b/tests/tests_basic.c index 6037ae2..8fd3580 100644 --- a/tests/tests_basic.c +++ b/tests/tests_basic.c @@ -5,11 +5,11 @@ int test_abs_short(void) { for (unsigned i = 0; i < TESTCASES_COUNT; ++i) { - fix16_t a = testcases[i]; - double fa = fix16_to_dbl(a); - fix16_t result = fix16_abs(a); - double fresult = fabs(fa); - double min = fix16_to_dbl(fix16_minimum); + fix16_t a = testcases[i]; + double fa = fix16_to_dbl(a); + fix16_t result = fix16_abs(a); + double fresult = fabs(fa); + double min = fix16_to_dbl(fix16_minimum); if (fa <= min) { #ifndef FIXMATH_NO_OVERFLOW -- cgit v1.2.3