diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-13 00:42:25 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-13 00:42:25 -0400 |
commit | 40f553228f5a28034c6635fdcb4c86af28a385ed (patch) | |
tree | 2c40305c9f9841a4c3d453a4a5c49ec69056b4b2 /test | |
parent | 556211e623cad88213e5087b5c9c36e754d9aa02 (diff) | |
parent | b1b4e2aadff5983d443d70c09ea86a41b015873f (diff) | |
download | fork-ledger-40f553228f5a28034c6635fdcb4c86af28a385ed.tar.gz fork-ledger-40f553228f5a28034c6635fdcb4c86af28a385ed.tar.bz2 fork-ledger-40f553228f5a28034c6635fdcb4c86af28a385ed.zip |
Merge branch 'next'
Diffstat (limited to 'test')
-rw-r--r-- | test/UnitTests.cc | 4 | ||||
-rw-r--r-- | test/UnitTests.h | 14 | ||||
-rw-r--r-- | test/baseline/opt-anon.test | 11 | ||||
-rw-r--r-- | test/regress/13965214.test | 16 | ||||
-rw-r--r-- | test/regress/5FBF2ED8.test | 18 | ||||
-rw-r--r-- | test/regress/86D2BDC4.test | 2 | ||||
-rw-r--r-- | test/regress/F559EC12.test | 2 | ||||
-rw-r--r-- | test/unit/t_amount.cc | 42 | ||||
-rw-r--r-- | test/unit/t_times.cc | 4 |
9 files changed, 52 insertions, 61 deletions
diff --git a/test/UnitTests.cc b/test/UnitTests.cc index 2c5c0406..af3f6311 100644 --- a/test/UnitTests.cc +++ b/test/UnitTests.cc @@ -35,7 +35,7 @@ public: void testInitialization() { assertEqual(std::string("Hello, world!"), - std::string("Hello, world!")); + std::string("Hello, world!")); } private: @@ -61,7 +61,7 @@ int main(int argc, char* argv[]) // Retreive test path from command line first argument. Default to // "" which resolves to the top level suite. std::string testPath = ((argc > index) ? std::string(argv[index]) : - std::string("")); + std::string("")); // Create the event manager and test controller CPPUNIT_NS::TestResult controller; diff --git a/test/UnitTests.h b/test/UnitTests.h index d9314ddf..a7bfcf9e 100644 --- a/test/UnitTests.h +++ b/test/UnitTests.h @@ -6,14 +6,14 @@ #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 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 assertMessage(x,y) CPPUNIT_ASSERT_MESSAGE(x,y) +#define assertThrow(x,y) CPPUNIT_ASSERT_THROW(x,y) #define internalAmount(x) amount_t::exact(x) diff --git a/test/baseline/opt-anon.test b/test/baseline/opt-anon.test deleted file mode 100644 index 345d981f..00000000 --- a/test/baseline/opt-anon.test +++ /dev/null @@ -1,11 +0,0 @@ -reg --anon -<<< -2007/02/02 RD VMMXX - Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 - Income:Dividends:Vanguard:VMMXX $-0.35 ->>>1 -07-Feb-02 6a93dcb3 da:20:5d:27:988a9c3a 0.350 A 0.350 A - da:1c:b6:27:988a9c3a B-0.35 0.350 A - B-0.35 ->>>2 -=== 0 diff --git a/test/regress/13965214.test b/test/regress/13965214.test index 674d4d7d..29a7278e 100644 --- a/test/regress/13965214.test +++ b/test/regress/13965214.test @@ -3,20 +3,20 @@ reg Y2008 01/30 A - Bank 130 - Income + Bank 130 + Income 02/01 B - Bank 140 - Income + Bank 140 + Income 02/20 C - Bank 150 - Income + Bank 150 + Income 03/01 D - Bank 160 - Income + Bank 160 + Income >>>1 08-Jan-30 A Bank 130 130 Income -130 0 diff --git a/test/regress/5FBF2ED8.test b/test/regress/5FBF2ED8.test index 78df5a6e..ad8454d1 100644 --- a/test/regress/5FBF2ED8.test +++ b/test/regress/5FBF2ED8.test @@ -1,16 +1,16 @@ bal -B <<< -2008/01/01 * Checking balance - Assets:Bank:Checking £0.00 - Equity:Opening Balances +2008/01/01 * Checking balance + Assets:Bank:Checking £0.00 + Equity:Opening Balances -2008/02/02 Salary - Income:Employer £-334.00 - Assets:Bank:Checking $512.85 @@ £334.00 +2008/02/02 Salary + Income:Employer £-334.00 + Assets:Bank:Checking $512.85 @@ £334.00 -2008/03/02 Salary - Income:Employer £-248.07 - Assets:Bank:Checking $404.82 @@ £248.07 +2008/03/02 Salary + Income:Employer £-248.07 + Assets:Bank:Checking $404.82 @@ £248.07 >>>1 £582.07 Assets:Bank:Checking £-582.07 Income:Employer diff --git a/test/regress/86D2BDC4.test b/test/regress/86D2BDC4.test index 8cd51e42..b6d4083c 100644 --- a/test/regress/86D2BDC4.test +++ b/test/regress/86D2BDC4.test @@ -2,7 +2,7 @@ reg -B <<< 2009/06/03 Westjet Expenses:Transportation:Air C$429.80 @ 1.572865 - Expenses:Bank:Fees 2.73 + Expenses:Bank:Fees 2.73 Liabilities:Mastercard >>>1 09-Jun-03 Westjet Ex:Transportation:Air 676.017377 676.017377 diff --git a/test/regress/F559EC12.test b/test/regress/F559EC12.test index c8b686db..d6b2521e 100644 --- a/test/regress/F559EC12.test +++ b/test/regress/F559EC12.test @@ -6,6 +6,7 @@ format "%-12(scrub(amount))" ; This note applies to all postings. :SecondTag: Expenses:Books 20 BOOK @ $10 ; Metadata: Some Value + ; Typed:: $100 + $200 ; :ExampleTag: ; Here follows a note describing the posting. Liabilities:MasterCard $-200.00 @@ -27,6 +28,7 @@ format "%12(scrub(amount))" ; This note applies to all postings. :SecondTag: Expenses:Books 20 BOOK @ $10 ; Metadata: Some Value + ; Typed:: $100 + $200 ; :ExampleTag: ; Here follows a note describing the posting. Liabilities:MasterCard $-200.00 diff --git a/test/unit/t_amount.cc b/test/unit/t_amount.cc index 63d82675..b1c7b837 100644 --- a/test/unit/t_amount.cc +++ b/test/unit/t_amount.cc @@ -249,7 +249,7 @@ void AmountTestCase::testAssignment() assertEqual(x10, x9); assertFalse(x1.is_null()); - x1 = x0; // sets x1 back to uninitialized state + x1 = x0; // sets x1 back to uninitialized state assertTrue(x0.is_null()); assertTrue(x1.is_null()); @@ -699,11 +699,11 @@ void AmountTestCase::testCommoditySubtraction() assertEqual(internalAmount("$123454434148472090.138858329277476789"), x7 - x8); assertEqual(string("$123454434148472090.138858329277476789"), (x7 - x8).to_string()); assertEqual(string("$123454434148472090.14"), - (amount_t("$1.00") * (x7 - x8)).to_string()); + (amount_t("$1.00") * (x7 - x8)).to_string()); assertEqual(internalAmount("$-123454434148472090.138858329277476789"), x8 - x7); assertEqual(string("$-123454434148472090.138858329277476789"), (x8 - x7).to_string()); assertEqual(string("$-123454434148472090.14"), - (amount_t("$1.00") * (x8 - x7)).to_string()); + (amount_t("$1.00") * (x8 - x7)).to_string()); assertValid(x1); assertValid(x2); @@ -743,7 +743,7 @@ void AmountTestCase::testIntegerMultiplication() amount_t x4("123456789123456789123456789"); assertEqual(amount_t("15241578780673678546105778281054720515622620750190521"), - x4 * x4); + x4 * x4); assertValid(x1); assertValid(y1); @@ -780,7 +780,7 @@ void AmountTestCase::testFractionalMultiplication() amount_t x2("123456789123456789.123456789123456789"); assertEqual(amount_t("15241578780673678546105778311537878.046486820281054720515622620750190521"), - x2 * x2); + x2 * x2); assertValid(x1); assertValid(y1); @@ -835,7 +835,7 @@ void AmountTestCase::testCommodityMultiplication() amount_t x7(internalAmount("$123456789123456789.123456789123456789")); assertEqual(internalAmount("$15241578780673678546105778311537878.046486820281054720515622620750190521"), - x7 * x7); + x7 * x7); assertValid(x1); assertValid(x2); @@ -877,7 +877,7 @@ void AmountTestCase::testIntegerDivision() assertEqual(string("2204585520061728377204585.517857"), (x4 / y4).to_string()); assertEqual(amount_t("0.000000000000000000000000000001"), - amount_t("10") / amount_t("10000000000000000000000000000000")); + amount_t("10") / amount_t("10000000000000000000000000000000")); assertValid(x1); assertValid(y1); @@ -973,9 +973,9 @@ void AmountTestCase::testCommodityDivision() assertEqual(amount_t("$1"), x7 / x7); assertEqual(string("$0.0019216115121765559608381226612019501"), - (x6 / x7).to_fullstring()); + (x6 / x7).to_fullstring()); assertEqual(string("$520.39654928343335571379527154924040947272"), - (x7 / x6).to_fullstring()); + (x7 / x6).to_fullstring()); assertValid(x1); assertValid(x2); @@ -1110,14 +1110,14 @@ void AmountTestCase::testReduction() amount_t x2("600s"); amount_t x3("6000s"); amount_t x4("360000s"); - amount_t x5("10m"); // 600s - amount_t x6("100m"); // 6000s - amount_t x7("1000m"); // 60000s - amount_t x8("10000m"); // 600000s - amount_t x9("10h"); // 36000s - amount_t x10("100h"); // 360000s - amount_t x11("1000h"); // 3600000s - amount_t x12("10000h"); // 36000000s + amount_t x5("10m"); // 600s + amount_t x6("100m"); // 6000s + amount_t x7("1000m"); // 60000s + amount_t x8("10000m"); // 600000s + amount_t x9("10h"); // 36000s + amount_t x10("100h"); // 360000s + amount_t x11("1000h"); // 3600000s + amount_t x12("10000h"); // 36000000s assertThrow(x0.reduce(), amount_error); assertThrow(x0.unreduce(), amount_error); @@ -1220,7 +1220,7 @@ void AmountTestCase::testCommodityForZero() { amount_t x1(internalAmount("$0.000000000000000000001")); - assertTrue(x1); // an internal amount never betrays its precision + assertTrue(x1); // an internal amount never betrays its precision assertFalse(x1.is_zero()); assertFalse(x1.is_realzero()); @@ -1287,7 +1287,7 @@ void AmountTestCase::testPrinting() x1.print(bufstr); assertEqual(std::string("982340823.380238098235098235098235098"), - bufstr.str()); + bufstr.str()); } assertValid(x0); @@ -1304,7 +1304,7 @@ void AmountTestCase::testCommodityPrinting() x1.print(bufstr); assertEqual(std::string("$982340823.386238098235098235098235098"), - bufstr.str()); + bufstr.str()); } { @@ -1312,7 +1312,7 @@ void AmountTestCase::testCommodityPrinting() (x1 * x2).print(bufstr); assertEqual(std::string("$964993493285024293.18099172508158508135413499124"), - bufstr.str()); + bufstr.str()); } { diff --git a/test/unit/t_times.cc b/test/unit/t_times.cc index d8a67b43..aaf31263 100644 --- a/test/unit/t_times.cc +++ b/test/unit/t_times.cc @@ -22,8 +22,8 @@ void DateTimeTestCase::tearDown() void DateTimeTestCase::testConstructors() { #ifndef NOT_FOR_PYTHON - std::time_t now = std::time(NULL); - struct tm * moment = std::localtime(&now); + std::time_t now = std::time(NULL); + struct tm * moment = std::localtime(&now); std::time_t localMoment = std::mktime(moment); #endif // NOT_FOR_PYTHON |