aboutsummaryrefslogtreecommitdiff
path: root/tests/tests_basic.c
diff options
context:
space:
mode:
authorMartin Baƙinka <marun1@email.cz>2021-05-03 12:43:54 +0200
committerGitHub <noreply@github.com>2021-05-03 13:43:54 +0300
commit0c88e55fa8f132e8ac15426911d155f136078302 (patch)
tree03fc1b22c0582bd57ae3a14095d3d9c9f949f0c9 /tests/tests_basic.c
parent4ea8f3ff12da61a5ceba690bf1e39d9385b42880 (diff)
downloadlibfixmath-0c88e55fa8f132e8ac15426911d155f136078302.tar.gz
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
Diffstat (limited to 'tests/tests_basic.c')
-rw-r--r--tests/tests_basic.c10
1 files changed, 5 insertions, 5 deletions
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