diff options
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | test/numerics/t_valexpr.cc | 25 | ||||
-rw-r--r-- | test/numerics/t_valexpr.h | 30 |
3 files changed, 57 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 06d0a12d..beaea2f9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -172,7 +172,8 @@ nodist_UnitTests_SOURCES = test/UnitTests.cc \ test/utility/t_times.cc \ test/numerics/t_commodity.cc \ test/numerics/t_amount.cc \ - test/numerics/t_balance.cc + test/numerics/t_balance.cc \ + test/numerics/t_valexpr.cc UnitTests_CPPFLAGS = -I$(srcdir)/test $(libledger_la_CPPFLAGS) UnitTests_LDFLAGS = $(LIBADD_DL) diff --git a/test/numerics/t_valexpr.cc b/test/numerics/t_valexpr.cc new file mode 100644 index 00000000..026b4eec --- /dev/null +++ b/test/numerics/t_valexpr.cc @@ -0,0 +1,25 @@ +#include "t_valexpr.h" + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(ValueExprTestCase, "numerics"); + +void ValueExprTestCase::setUp() +{ + ledger::set_session_context(&session); + + // 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 ValueExprTestCase::tearDown() +{ + amount_t::stream_fullstrings = false; + + ledger::set_session_context(); +} + +void ValueExprTestCase::testConstructors() +{ +} diff --git a/test/numerics/t_valexpr.h b/test/numerics/t_valexpr.h new file mode 100644 index 00000000..3cac4ed6 --- /dev/null +++ b/test/numerics/t_valexpr.h @@ -0,0 +1,30 @@ +#ifndef _T_VALEXPR_H +#define _T_VALEXPR_H + +#include "UnitTests.h" + +class ValueExprTestCase : public CPPUNIT_NS::TestCase +{ + CPPUNIT_TEST_SUITE(ValueExprTestCase); + + CPPUNIT_TEST(testConstructors); + + CPPUNIT_TEST_SUITE_END(); + +public: + ledger::session_t session; + + ValueExprTestCase() {} + virtual ~ValueExprTestCase() {} + + virtual void setUp(); + virtual void tearDown(); + + void testConstructors(); + +private: + ValueExprTestCase(const ValueExprTestCase ©); + void operator=(const ValueExprTestCase ©); +}; + +#endif // _T_VALEXPR_H |