diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-02 03:05:10 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:35 -0400 |
commit | 103881ff80008b09608550de5b72b91509eb9fff (patch) | |
tree | 00d4fb5710d9a76dca3130478f67ba408a99dafe /tests | |
parent | 9e80a6fbcc837c0bfc3f5846347da1a25364ba44 (diff) | |
download | fork-ledger-103881ff80008b09608550de5b72b91509eb9fff.tar.gz fork-ledger-103881ff80008b09608550de5b72b91509eb9fff.tar.bz2 fork-ledger-103881ff80008b09608550de5b72b91509eb9fff.zip |
First round of using boost/operators is done.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/numerics/BasicAmount.cc | 8 | ||||
-rw-r--r-- | tests/numerics/CommodityAmount.cc | 4 | ||||
-rw-r--r-- | tests/python/numerics/CommodityAmount.py | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/tests/numerics/BasicAmount.cc b/tests/numerics/BasicAmount.cc index 626c3ba8..bcc5c2b5 100644 --- a/tests/numerics/BasicAmount.cc +++ b/tests/numerics/BasicAmount.cc @@ -415,8 +415,8 @@ void BasicAmountTestCase::testIntegerConversion() amount_t x1(123456L); assertEqual(true, bool(x1)); - assertEqual(123456L, long(x1)); - assertEqual(123456.0, double(x1)); + assertEqual(123456L, x1.to_long()); + assertEqual(123456.0, x1.to_double()); assertEqual(string("123456"), x1.to_string()); assertEqual(string("123456"), x1.quantity_string()); @@ -428,8 +428,8 @@ void BasicAmountTestCase::testFractionalConversion() amount_t x1(1234.56); assertEqual(true, bool(x1)); - assertEqual(1234L, long(x1)); - assertEqual(1234.56, double(x1)); + assertEqual(1234L, x1.to_long()); + assertEqual(1234.56, x1.to_double()); assertEqual(string("1234.56"), x1.to_string()); assertEqual(string("1234.56"), x1.quantity_string()); diff --git a/tests/numerics/CommodityAmount.cc b/tests/numerics/CommodityAmount.cc index ffedbdac..e443d6a1 100644 --- a/tests/numerics/CommodityAmount.cc +++ b/tests/numerics/CommodityAmount.cc @@ -465,8 +465,8 @@ void CommodityAmountTestCase::testConversion() amount_t x1("$1234.56"); assertEqual(true, bool(x1)); - assertEqual(1234L, long(x1)); - assertEqual(1234.56, double(x1)); + assertEqual(1234L, x1.to_long()); + assertEqual(1234.56, x1.to_double()); assertEqual(string("$1234.56"), x1.to_string()); assertEqual(string("1234.56"), x1.quantity_string()); diff --git a/tests/python/numerics/CommodityAmount.py b/tests/python/numerics/CommodityAmount.py index 80f58b21..5c177044 100644 --- a/tests/python/numerics/CommodityAmount.py +++ b/tests/python/numerics/CommodityAmount.py @@ -177,7 +177,7 @@ class CommodityAmountTestCase(unittest.TestCase): x9 = amount("123.45€") x10 = amount("-123.45€") - self.assertTrue(x0.null()) + self.assertTrue(x0.is_null()) self.assertTrue(x0.zero()) self.assertTrue(x0.realzero()) self.assertTrue(x0.sign() == 0) |