Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | More unit tests for amount_t::roundto | Max Nikulin | 2024-08-07 | 1 | -1/+13 |
| | | | | | - Add some tests from comments to pull request #2361. - Fix decimal separator in earlier added tests. | ||||
* | Fix copy on write for amount_t::in_place_roundto | Max Nikulin | 2024-08-06 | 1 | -3/+2 |
| | | | | | | | | | | | | - Copy amount quantity before rounding. - Fix `amount_t::roundto(int)`. - Transform `balance/testRound` into `balance/testRoundto`. It was a mix of `round` and `roundto` operation with unclear purpose and was relying on `in_place_roundto` behavior modifying all copies. There is no unit tests for balance `round` and `unround` any more. Closes #2362 | ||||
* | Fix denominator of roundto result | Max Nikulin | 2024-08-05 | 1 | -0/+12 |
| | | | | | | | | | | | | | | | | | | Multiprecision rational created from a double value may have large power of 2 denominator since fractional decimal numbers can not be represented as binary floating point numbers. It leads to failed assertion when result is compared to a value converted directly from strings. Use integer multiprecision arithmetics to round numbers to ensure proper denominator. Inspired by python gmpy2 package <https://github.com/aleaxit/gmpy/blob/3e4564ae9d/src/gmpy2_mpq_misc.c#L315> The change makes `roundto` symmetric for positive/negative arguments. Halves are rounded to nearest even. Rounded away from zero are discussed in #1663 and it may be achieved with minimal modification. - See #2329 - Closes #1983 | ||||
* | add unit tests for amount_t→floor/ceil | Johann Klähn | 2013-01-15 | 1 | -0/+54 |
| | |||||
* | Fixed several unit tests | John Wiegley | 2011-02-04 | 1 | -9/+13 |
| | |||||
* | Use Boost.Test instead of CppUnit | John Wiegley | 2011-02-04 | 1 | -718/+724 |
| | |||||
* | Untabified all source files | John Wiegley | 2010-06-11 | 1 | -21/+21 |
| | |||||
* | Changed --european option to --decimal-comma | John Wiegley | 2010-06-01 | 1 | -3/+3 |
| | | | | Fixes #211 / 1736ACA5-5DE6-4826-AEB4-DB5B2A2217AC | ||||
* | Redesigned the expr_t, predicate_t, query_t classes | John Wiegley | 2009-11-09 | 1 | -9/+9 |
| | |||||
* | Call times_initialize/shutdown in the unit tests | John Wiegley | 2009-10-25 | 1 | -0/+2 |
| | |||||
* | Don't increase precision so much when dividing | John Wiegley | 2009-06-15 | 1 | -20/+20 |
| | | | | | | | | | Slow the increase in internal precision when dividing amounts. Use "--debug amount.convert" if you wish to see this logic in action, if a case where incorrect rounding is suspected comes up. Fixes B68FFB0D-A9A0-479C-A6C0-68853F229333 | ||||
* | Enabled use of pre-compiled headers by default | John Wiegley | 2009-03-10 | 1 | -0/+2 |
| | |||||
* | Corrected warnings g++-4.3.3 was complaining about | John Wiegley | 2009-02-28 | 1 | -5/+7 |
| | |||||
* | Allow uncommoditized amounts to +/- with an amount | John Wiegley | 2009-02-25 | 1 | -6/+6 |
| | | | | Thus, you can say "$100 + 10" to increase it by $10. | ||||
* | Be smarter about printing uncommoditized amounts | John Wiegley | 2009-02-24 | 1 | -5/+5 |
| | |||||
* | Restored the --budget option | John Wiegley | 2009-02-20 | 1 | -9/+9 |
| | |||||
* | Fixed some incorrect #includes. | John Wiegley | 2009-02-07 | 1 | -1/+1 |
| | |||||
* | Largely removed all of Ledger's use of global variables, for the REPL's sake. | John Wiegley | 2009-02-04 | 1 | -3/+7 |
| | |||||
* | Removed serialization tests from the amount_t unit tests. | John Wiegley | 2009-02-03 | 1 | -89/+0 |
| | |||||
* | Added a more efficient amount_t::operator==, which changed semantics slightly. | John Wiegley | 2009-01-31 | 1 | -4/+3 |
| | |||||
* | Rationals based math is now passing the unit tests. | John Wiegley | 2009-01-31 | 1 | -196/+23 |
| | |||||
* | Several corrections to the way rationals are handled. | John Wiegley | 2009-01-31 | 1 | -40/+47 |
| | |||||
* | Don't perform rounding tests in Python. | John Wiegley | 2009-01-31 | 1 | -0/+6 |
| | |||||
* | Removed all dependency on gdtoa. | John Wiegley | 2009-01-30 | 1 | -16/+3 |
| | |||||
* | Fixed the amount_t unit test. | John Wiegley | 2009-01-30 | 1 | -9/+9 |
| | |||||
* | Unit test for Python are now auto-generated from the C++ tests. | John Wiegley | 2009-01-28 | 1 | -64/+70 |
| | |||||
* | Reorganized Ledger so that it builds as 7 separate libraries. This is mainly | John Wiegley | 2009-01-25 | 1 | -4/+8 |
| | | | | to prove to myself that it has proper decoupling between prior code areas. | ||||
* | Increase code coverage of the unit tests. | John Wiegley | 2008-08-13 | 1 | -4/+0 |
| | |||||
* | Moved the test sources around, so that all the unit tests are in test/unit. | John Wiegley | 2008-08-05 | 1 | -0/+1576 |