summaryrefslogtreecommitdiff
path: root/tests/numerics/CommodityAmount.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-04-30 11:22:08 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:34 -0400
commit21af83013f3b1bae511a61b9e27224ab3de235c1 (patch)
treebf0eea45f33e7e269220adc6ce37815f7bc14a3f /tests/numerics/CommodityAmount.cc
parent3ba6c2572dfc58bcd963cbc8cac1cce2f5b01dba (diff)
downloadfork-ledger-21af83013f3b1bae511a61b9e27224ab3de235c1.tar.gz
fork-ledger-21af83013f3b1bae511a61b9e27224ab3de235c1.tar.bz2
fork-ledger-21af83013f3b1bae511a61b9e27224ab3de235c1.zip
Did more work on the utility code.
Diffstat (limited to 'tests/numerics/CommodityAmount.cc')
-rw-r--r--tests/numerics/CommodityAmount.cc42
1 files changed, 21 insertions, 21 deletions
diff --git a/tests/numerics/CommodityAmount.cc b/tests/numerics/CommodityAmount.cc
index 7ed7f403..2f676697 100644
--- a/tests/numerics/CommodityAmount.cc
+++ b/tests/numerics/CommodityAmount.cc
@@ -232,13 +232,13 @@ void CommodityAmountTestCase::testAddition()
assertEqual(string("$246.90"), (x1 + x1).to_string());
assertEqual(string("$246.91"), (x1 + x2).to_string());
- assertThrow(x1 + x0, amount_exception);
- assertThrow(x1 + x3, amount_exception);
- assertThrow(x1 + x4, amount_exception);
- assertThrow(x1 + x5, amount_exception);
- assertThrow(x1 + x6, amount_exception);
- assertThrow(x1 + 123.45, amount_exception);
- assertThrow(x1 + 123L, amount_exception);
+ assertThrow(x1 + x0, amount_error);
+ assertThrow(x1 + x3, amount_error);
+ assertThrow(x1 + x4, amount_error);
+ assertThrow(x1 + x5, amount_error);
+ assertThrow(x1 + x6, amount_error);
+ assertThrow(x1 + 123.45, amount_error);
+ assertThrow(x1 + 123L, amount_error);
assertEqual(amount_t("DM 246.90"), x3 + x3);
assertEqual(amount_t("246.90 euro"), x4 + x4);
@@ -290,13 +290,13 @@ void CommodityAmountTestCase::testSubtraction()
assertEqual(string("$0.00"), (x1 - x1).to_string());
assertEqual(string("$-0.01"), (x1 - x2).to_string());
- assertThrow(x1 - x0, amount_exception);
- assertThrow(x1 - x3, amount_exception);
- assertThrow(x1 - x4, amount_exception);
- assertThrow(x1 - x5, amount_exception);
- assertThrow(x1 - x6, amount_exception);
- assertThrow(x1 - 123.45, amount_exception);
- assertThrow(x1 - 123L, amount_exception);
+ assertThrow(x1 - x0, amount_error);
+ assertThrow(x1 - x3, amount_error);
+ assertThrow(x1 - x4, amount_error);
+ assertThrow(x1 - x5, amount_error);
+ assertThrow(x1 - x6, amount_error);
+ assertThrow(x1 - 123.45, amount_error);
+ assertThrow(x1 - 123L, amount_error);
assertEqual(amount_t("DM 0.00"), x3 - x3);
assertEqual(amount_t("DM 23.45"), x3 - amount_t("DM 100.00"));
@@ -374,9 +374,9 @@ void CommodityAmountTestCase::testMultiplication()
assertEqual(string("$15200.00"), (x1 * x2).to_string());
assertEqual(string("$15199.99986168"), (x2 * x1).to_string());
- assertThrow(x1 * x3, amount_exception);
- assertThrow(x1 * x4, amount_exception);
- assertThrow(x1 * x5, amount_exception);
+ assertThrow(x1 * x3, amount_error);
+ assertThrow(x1 * x4, amount_error);
+ assertThrow(x1 * x5, amount_error);
x1 *= amount_t("123.12");
assertEqual(internalAmount("$15158.5344"), x1);
@@ -410,7 +410,7 @@ void CommodityAmountTestCase::testDivision()
amount_t x4("123.45 euro");
amount_t x5("123.45€");
- assertThrow(x1 / 0L, amount_exception);
+ assertThrow(x1 / 0L, amount_error);
assertEqual(amount_t("$0.00"), 0L / x1);
assertEqual(x1, x1 / 1L);
assertEqual(internalAmount("$0.00812216"), 1L / x1);
@@ -428,9 +428,9 @@ void CommodityAmountTestCase::testDivision()
assertEqual(string("$1.00"), (x1 / x2).to_string());
assertEqual(string("$1.00273545321637426901"), (x2 / x1).to_string());
- assertThrow(x1 / x3, amount_exception);
- assertThrow(x1 / x4, amount_exception);
- assertThrow(x1 / x5, amount_exception);
+ assertThrow(x1 / x3, amount_error);
+ assertThrow(x1 / x4, amount_error);
+ assertThrow(x1 / x5, amount_error);
x1 /= amount_t("123.12");
assertEqual(internalAmount("$1.00"), x1);