summaryrefslogtreecommitdiff
path: root/tests/unit/core/test-core-calc.cpp
AgeCommit message (Collapse)Author
2022-01-17core: update copyright datesSébastien Helleu
2021-01-02core: update copyright datesSébastien Helleu
2020-04-11tests: add missing include of locale.hSébastien Helleu
This fixes build of tests on FreeBSD.
2020-04-10tests: fix name of testsSébastien Helleu
2020-04-08tests: add tests on calc functionsSébastien Helleu
Functions tested: - calc_operator_precedence - calc_pop_value - calc_list_free_cb - calc_operation - calc_operation_stacks
2020-04-07tests: add missing include of stdio.h (issue #1469)Sébastien Helleu
2020-04-07core: fix memory leak in calculation of expression on FreeBSD (closes #1469)Sébastien Helleu
The memory leak was caused by a bug in function setlocale on FreeBSD: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243195 The fix is the following: * Remove the calls to setlocale when formatting the result. * The function snprintf is still called, and then is now locale dependent, for example in French the decimal separator is a comma instead of a dot. * A new function calc_sanitize_decimal_number is introduced to "sanitize" a decimal number: keep only the decimal separator (replace it by a dot) and remove any other separator found. Unit tests are added on these functions: * calc_sanitize_decimal_number * calc_format_result
2020-01-27tests: add other calc tests with multiple operatorsSébastien Helleu
The order of operators are different from the initial test, so this increases the code coverage in wee-calc.c.
2020-01-04core: update copyright datesSébastien Helleu
2019-09-24core: add power operator "**" in calc expressions (issue #997)Sébastien Helleu
2019-09-24core: fix wrong results with the unary minus in calc expressionsSébastien Helleu
2019-09-20core: add calculation of expression in evaluation of expressions with ↵Sébastien Helleu
"calc:..." (issue #997)