diff options
author | tripun <tripun@gmail.com> | 2014-08-16 19:36:36 +0530 |
---|---|---|
committer | tripun <tripun@gmail.com> | 2014-08-16 19:40:23 +0530 |
commit | b8cb110720c4034db2b0e8a61acc965ff2bc8c59 (patch) | |
tree | ed7d793f57bbb1ff5971d0db29703cb7fbd751e8 /test/unit | |
parent | 53572549d35c6907f4e76798cfba018f502de501 (diff) | |
download | fork-ledger-b8cb110720c4034db2b0e8a61acc965ff2bc8c59.tar.gz fork-ledger-b8cb110720c4034db2b0e8a61acc965ff2bc8c59.tar.bz2 fork-ledger-b8cb110720c4034db2b0e8a61acc965ff2bc8c59.zip |
initialize value fixture
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/t_value.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/unit/t_value.cc b/test/unit/t_value.cc index e69de29b..96d644a6 100644 --- a/test/unit/t_value.cc +++ b/test/unit/t_value.cc @@ -0,0 +1,37 @@ +#define BOOST_TEST_DYN_LINK + +#include <boost/test/unit_test.hpp> + +#include <system.hh> + +#include "value.h" + +using namespace ledger; + +struct value_fixture { + value_fixture() { + times_initialize(); + amount_t::initialize(); + value_t::initialize(); + + + // Cause the display precision for dollars to be initialized to 2. + amount_t x1("$1.00"); + BOOST_CHECK(x1); + + amount_t::stream_fullstrings = true; // make reports from UnitTests accurate + } + + ~value_fixture() + { + amount_t::stream_fullstrings = false; + amount_t::shutdown(); + times_shutdown(); + value_t::shutdown(); + } +}; + +BOOST_FIXTURE_TEST_SUITE(value, value_fixture) + +BOOST_AUTO_TEST_SUITE_END() + |