diff options
Diffstat (limited to 'tests/numerics/BasicAmount.cc')
-rw-r--r-- | tests/numerics/BasicAmount.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/numerics/BasicAmount.cc b/tests/numerics/BasicAmount.cc index f386d8f4..a6772b13 100644 --- a/tests/numerics/BasicAmount.cc +++ b/tests/numerics/BasicAmount.cc @@ -612,7 +612,8 @@ void BasicAmountTestCase::testFractionalConversion() amount_t x1(1234.56); assertEqual(true, bool(x1)); - assertEqual(1234L, x1.to_long()); + assertThrow(x1.to_long(), amount_error); // loses precision + assertEqual(1234L, x1.to_long(true)); assertEqual(1234.56, x1.to_double()); assertEqual(string("1234.56"), x1.to_string()); assertEqual(string("1234.56"), x1.quantity_string()); |