diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-16 10:46:05 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:53 -0400 |
commit | 2d8512af88eab26176089e53916f309f2d3b3be4 (patch) | |
tree | 5d0b6217a3367099d8a3fdb2866acc433c38e078 /tests/numerics | |
parent | 1134fc7eff7094700abf16c2e532d7c3c40ae68d (diff) | |
download | fork-ledger-2d8512af88eab26176089e53916f309f2d3b3be4.tar.gz fork-ledger-2d8512af88eab26176089e53916f309f2d3b3be4.tar.bz2 fork-ledger-2d8512af88eab26176089e53916f309f2d3b3be4.zip |
Changed all uses of scope_t * to scope_t&
Diffstat (limited to 'tests/numerics')
-rw-r--r-- | tests/numerics/t_amount.cc | 88 |
1 files changed, 51 insertions, 37 deletions
diff --git a/tests/numerics/t_amount.cc b/tests/numerics/t_amount.cc index a47e9bb3..37e7ebae 100644 --- a/tests/numerics/t_amount.cc +++ b/tests/numerics/t_amount.cc @@ -209,23 +209,15 @@ void AmountTestCase::testCommodityConstructors() void AmountTestCase::testAssignment() { amount_t x0; - amount_t x1 = 123456L; - amount_t x2 = 123456UL; - amount_t x3 = 123.456; - amount_t x5 = "123456"; - amount_t x6 = "123.456"; - amount_t x7 = string("123456"); - amount_t x8 = string("123.456"); - amount_t x9 = x3; - amount_t x10 = amount_t(x6); - - assertEqual(x2, x1); - assertEqual(x5, x1); - assertEqual(x7, x1); - assertEqual(x6, x3); - assertEqual(x8, x3); - assertEqual(x10, x3); - assertEqual(x10, x9); + amount_t x1; + amount_t x2; + amount_t x3; + amount_t x5; + amount_t x6; + amount_t x7; + amount_t x8; + amount_t x9; + amount_t x10; x1 = 123456L; x2 = 123456UL; @@ -264,16 +256,27 @@ void AmountTestCase::testAssignment() void AmountTestCase::testCommodityAssignment() { - amount_t x1 = "$123.45"; - amount_t x2 = "-$123.45"; - amount_t x3 = "$-123.45"; - amount_t x4 = "DM 123.45"; - amount_t x5 = "-DM 123.45"; - amount_t x6 = "DM -123.45"; - amount_t x7 = "123.45 euro"; - amount_t x8 = "-123.45 euro"; - amount_t x9 = "123.45€"; - amount_t x10 = "-123.45€"; + amount_t x1; + amount_t x2; + amount_t x3; + amount_t x4; + amount_t x5; + amount_t x6; + amount_t x7; + amount_t x8; + amount_t x9; + amount_t x10; + + x1 = "$123.45"; + x2 = "-$123.45"; + x3 = "$-123.45"; + x4 = "DM 123.45"; + x5 = "-DM 123.45"; + x6 = "DM -123.45"; + x7 = "123.45 euro"; + x8 = "-123.45 euro"; + x9 = "123.45€"; + x10 = "-123.45€"; assertEqual(amount_t("$123.45"), x1); assertEqual(amount_t("-$123.45"), x2); @@ -343,16 +346,27 @@ void AmountTestCase::testEquality() void AmountTestCase::testCommodityEquality() { amount_t x0; - amount_t x1 = "$123.45"; - amount_t x2 = "-$123.45"; - amount_t x3 = "$-123.45"; - amount_t x4 = "DM 123.45"; - amount_t x5 = "-DM 123.45"; - amount_t x6 = "DM -123.45"; - amount_t x7 = "123.45 euro"; - amount_t x8 = "-123.45 euro"; - amount_t x9 = "123.45€"; - amount_t x10 = "-123.45€"; + amount_t x1; + amount_t x2; + amount_t x3; + amount_t x4; + amount_t x5; + amount_t x6; + amount_t x7; + amount_t x8; + amount_t x9; + amount_t x10; + + x1 = "$123.45"; + x2 = "-$123.45"; + x3 = "$-123.45"; + x4 = "DM 123.45"; + x5 = "-DM 123.45"; + x6 = "DM -123.45"; + x7 = "123.45 euro"; + x8 = "-123.45 euro"; + x9 = "123.45€"; + x10 = "-123.45€"; assertTrue(x0.is_null()); assertThrow(x0.is_zero(), amount_error); |