summaryrefslogtreecommitdiff
path: root/test/numerics
diff options
context:
space:
mode:
Diffstat (limited to 'test/numerics')
-rw-r--r--test/numerics/t_valexpr.cc25
-rw-r--r--test/numerics/t_valexpr.h30
2 files changed, 55 insertions, 0 deletions
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 &copy);
+ void operator=(const ValueExprTestCase &copy);
+};
+
+#endif // _T_VALEXPR_H