summaryrefslogtreecommitdiff
path: root/test/unit/t_balance.cc
blob: 335d1a52d916f5a1b437fa7e1caed425a9bd31e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#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()
{
  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();
}