diff options
Diffstat (limited to 'test/unit/t_balance.cc')
-rw-r--r-- | test/unit/t_balance.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/unit/t_balance.cc b/test/unit/t_balance.cc new file mode 100644 index 00000000..c7d633b8 --- /dev/null +++ b/test/unit/t_balance.cc @@ -0,0 +1,29 @@ +#include <system.hh> + +#include "t_balance.h" + +#include "utils.h" +#include "amount.h" + +using namespace ledger; + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(BalanceTestCase, "math"); + +void BalanceTestCase::setUp() +{ + times_initialize(); + amount_t::initialize(); + + // Cause the display precision for dollars to be initialized to 2. + amount_t x1("$1.00"); + assertTrue(x1); + + amount_t::stream_fullstrings = true; // make reports from UnitTests accurate +} + +void BalanceTestCase::tearDown() +{ + amount_t::stream_fullstrings = false; + amount_t::shutdown(); + times_shutdown(); +} |