summaryrefslogtreecommitdiff
path: root/test/UnitTests.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-04-12 01:37:50 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-05-08 02:50:18 -0400
commit289cc97d45bbd3a8cdfcc3371ade71715b75b000 (patch)
tree2b1ab8575232260c4eb779282e03f64783ccb756 /test/UnitTests.h
parent627769ccc88ae15c92c5c2e5896bb1d96f52e385 (diff)
downloadfork-ledger-289cc97d45bbd3a8cdfcc3371ade71715b75b000.tar.gz
fork-ledger-289cc97d45bbd3a8cdfcc3371ade71715b75b000.tar.bz2
fork-ledger-289cc97d45bbd3a8cdfcc3371ade71715b75b000.zip
Exchanged old test files for the new testing code in was-v3.0.
Diffstat (limited to 'test/UnitTests.h')
-rw-r--r--test/UnitTests.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/UnitTests.h b/test/UnitTests.h
new file mode 100644
index 00000000..e7027cf4
--- /dev/null
+++ b/test/UnitTests.h
@@ -0,0 +1,24 @@
+#ifndef _UNITTESTS_H
+#define _UNITTESTS_H
+
+#include "ledger.h"
+
+using namespace ledger;
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/Exception.h>
+#include <cppunit/Portability.h>
+
+#define assertDoublesEqual(x,y,z,w) CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(x,y,z,w)
+#define assertEqual(x,y) CPPUNIT_ASSERT_EQUAL(x,y)
+#define assertNotEqual(x,y) CPPUNIT_ASSERT((x) != (y))
+#define assertTrue(x) CPPUNIT_ASSERT(x)
+#define assertFalse(x) CPPUNIT_ASSERT(! (x))
+#define assertValid(x) CPPUNIT_ASSERT((x).valid())
+#define assertEqualMessage(x,y,z) CPPUNIT_ASSERT_EQUAL_MESSAGE(x,y,z)
+#define assertMessage(x,y) CPPUNIT_ASSERT_MESSAGE(x,y)
+#define assertThrow(x,y) CPPUNIT_ASSERT_THROW(x,y)
+
+#define internalAmount(x) amount_t::exact(x)
+
+#endif /* _UNITTESTS_H */