diff options
author | MarcoFalke <falke.marco@gmail.com> | 2016-01-19 17:47:55 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2016-03-14 15:49:33 +0100 |
commit | fa3a81af18347a1d3fed41aa89ee643cbf0e7abc (patch) | |
tree | 4c6831ff69556eb7abd83fc6a71db2f3e6d3df77 /src/test | |
parent | 9f33dba05c01ecc5c56eb1284ab7d64d42f55171 (diff) |
[tests] Extend util_ParseMoney test case
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/util_tests.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 43e8ae9b36..b99f952a0d 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -200,6 +200,8 @@ BOOST_AUTO_TEST_CASE(util_ParseMoney) BOOST_CHECK_EQUAL(ret, COIN*10); BOOST_CHECK(ParseMoney("1.00", ret)); BOOST_CHECK_EQUAL(ret, COIN); + BOOST_CHECK(ParseMoney("1", ret)); + BOOST_CHECK_EQUAL(ret, COIN); BOOST_CHECK(ParseMoney("0.1", ret)); BOOST_CHECK_EQUAL(ret, COIN/10); BOOST_CHECK(ParseMoney("0.01", ret)); @@ -219,6 +221,9 @@ BOOST_AUTO_TEST_CASE(util_ParseMoney) // Attempted 63 bit overflow should fail BOOST_CHECK(!ParseMoney("92233720368.54775808", ret)); + + // Parsing negative amounts must fail + BOOST_CHECK(!ParseMoney("-1", ret)); } BOOST_AUTO_TEST_CASE(util_IsHex) |